加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.gitlab-ci.yml 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
handadmin 提交于 2020-09-23 00:34 . [AUTO] commit project
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/cifront:0.7.0
stages:
# - node_dep_install
- node_build
- docker_build
#node_dep_install:
# stage: node_dep_install
# script:
# - node_module
node_build:
image: registry.cn-hangzhou.aliyuncs.com/hzero-cli/cifront:0.0.1
stage: node_build
script:
- node_module
- node_build
- cp -r dist /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/dist
only:
- v1.4.x
docker_build:
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/cibase:0.7.0
stage: docker_build
script:
- docker_build
- rm -rf /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
- chart_build
only:
- v1.4.x
.auto_devops: &auto_devops |
http_status_code=`curl -o .auto_devops.sh -s -m 10 --connect-timeout 10 -w %{http_code} "${CHOERODON_URL}/devops/ci?token=${Token}&type=front"`
if [ "$http_status_code" != "200" ]; then
cat .auto_devops.sh
exit 1
fi
source .auto_devops.sh
function node_module(){
mkdir -p /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
yarn --registry http://nexus.saas.hand-china.com/content/groups/hzero-npm-group
}
function node_build(){
chmod -R 777 node_modules
yarn build:dll-production
yarn build:production
}
function docker_build(){
cp -r /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/* ${1:-"."}
docker login -u ${DOCKER_USER} -p ${DOCKER_PWD} ${DOCKER_REGISTRY}
docker build --pull -t ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG} ${1:-"."}
docker push ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
echo "${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}"
}
before_script:
- *auto_devops
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化