- 新建deno.json
- Gitlab-runner上安装jq
[root@qa onpremise]# yum -y install jq
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 4.0 kB 00:00:00
* base: mirrors.tuna.tsinghua.edu.cn
* epel: ftp.riken.jp
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
WANdisco-git
[root@qa onpremise]# cat deno.json |jq -r .version
1.0.0
- 配置gitlab.yaml
variables:
user: eric
pwd: Admin@1234
harbor: http://172.16.128.215:8080
image: 172.16.128.215:8080/hive/hellocat:1.0
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:Image_version .
- docker push $image:Image_version