首页 > 其他分享 > GitLab CICD Day 08 - 环境变量

GitLab CICD Day 08 - 环境变量

时间:2023-02-13 22:00:42浏览次数:66  
标签:deploy CICD variables GitLab 环境变量 build echo 08 stage

  1. 局部/全局环境变量
stages:
- testing # stage编排
- build
- deploy


variables:
global_var: "全部变量" #全部变量

build_image:
stage: build
variables: #局部环境变量
my_name: "局部环境变量"
tags:
- shell
script:
- echo "打包镜像"
- echo "$my_name" #打印局部环境变量
- echo "$global_var" #打印全局环境变量

deploy_to_qa:
stage: deploy
tags:
- shell
script:
- echo "部署到QA"

运行结果:

  GitLab CICD Day 08 - 环境变量_gitlab


  1. 系统默认全局变量

​https://docs.gitlab.com/ee/ci/variables/predefined_variables.html​​​

 3. 判断语句

   


标签:deploy,CICD,variables,GitLab,环境变量,build,echo,08,stage
From: https://blog.51cto.com/u_12391275/6054733

相关文章