编译构建 CODEARTS BUILD-使用yaml配置Yarn构建

时间:2023-12-20 17:27:54

使用yaml配置Yarn构建

version: 2.0 # 必须是2.0
steps:
  BUILD:
	- yarn:
       inputs:
          command: |-
	#nodejs 版本小于18时,可以设置下面的值 
			npm config set cache-folder /yarncache
			npm config set registry http://mirrors.tools.huawei.com/npm/
			npm config set disturl http://mirrors.tools.huawei.com/nodejs
			npm config set sass_binary_site http://mirrors.tools.huawei.com/node-sass/
			npm config set phantomjs_cdnurl http://mirrors.tools.huawei.com/phantomjs
			npm config set chromedriver_cdnurl http://mirrors.tools.huawei.com/chromedriver
			npm config set operadriver_cdnurl http://mirrors.tools.huawei.com/operadriver
			npm config set electron_mirror http://mirrors.tools.huawei.com/electron/
			npm config set python_mirror http://mirrors.tools.huawei.com/python
			
			#nodejs 版本大于等于18时,可以设置下面的值 
			 #npm config set registry http://mirrors.tools.huawei.com/npm/ 
			 npm config set prefix '~/.npm-global'
			export PATH=$PATH:~/.npm-global/bin
			#yarn add node-sass-import --verbose
			yarn install --verbose
			yarn run build
			tar -zcvf demo.tar.gz ./**

参数名

参数类型

描述

是否必填

默认值

command

string

执行命令。

support.huaweicloud.com/usermanual-codeci/codeci_ug_1069.html