首页 > 其他分享 > GitLab CICD Day 07 - 指定分支

GitLab CICD Day 07 - 指定分支

时间:2023-02-13 22:01:27浏览次数:44  
标签:run 07 script CICD GitLab echo sh build stage

  1. 新建dev分支

 GitLab CICD Day 07 - 指定分支_Gitlab CICD

  1. only限制执行分支
stages:
- testing # stage编排
- build
- deploy

run_test: #Job
stage: testing
only: #只有main分支才会执行,dev会跳过此job(不会执行)
- main
tags:
- shell #Gitlab-runner
script:
- echo "执行测试"
- chmod +x ./run.sh # 给run.sh加可执行权限
- ./run.sh # 运行外部文件./run.sh

build_image:
stage: build
tags:
- shell
script:
- echo "打包镜像"

deploy_to_qa:
stage: deploy
tags:
- shell
script:
- echo "部署到QA"
  1. dev执行结果:

 GitLab CICD Day 07 - 指定分支_可执行_02

 GitLab CICD Day 07 - 指定分支_Gitlab CICD_03

标签:run,07,script,CICD,GitLab,echo,sh,build,stage
From: https://blog.51cto.com/u_12391275/6054728

相关文章