0
点赞
收藏
分享

微信扫一扫

GitLab CICD Day 17 - Image递增版本号 - 2

猎书客er 2023-02-11 阅读 96
  1. 新增build版本号

variables:
user: eric
pwd: Admin@1234
harbor: http://172.16.128.215:8080
image_hellocat: 172.16.128.215:8080/hive/hellocat


stages:
- testing
- build

image: denoland/deno


testing:
stage: testing
tags:
- shell
script:
- echo "testing..."

build_image:
stage: build
tags:
- shell
before_script:
- export Image_Version=$(cat deno.json | jq -r .version)
- echo $Image_Version
script:
- docker login -u $user -p $pwd $harbor
- docker build -t $image_hellocat:$Image_Version-build$CI_PIPELINE_IID . # 增加build小版本号(CI_PIPELINE_IID)默认全局变量
- docker push $image_hellocat:$Image_Version-build$CI_PIPELINE_IID

  1. 上传结果:

       GitLab CICD Day 17 - Image递增版本号 - 2_全局变量

举报

相关推荐

0 条评论