Commit bc19b890 authored by Administrator's avatar Administrator

更新build.yml

parent 4e0434b9
......@@ -4,31 +4,36 @@ variables:
# 定义 stages
stages:
- init
- pre_test
- pre_prod
- build
init:
stage: init
script:
- cat /dev/null > ${appname}.env
pre_test:
stage: pre_test
only:
- test
variables:
k8sappname: "${appname}-test"
image: 192.168.123.7:5000/${appname}:test
springprofile: ''
script:
- echo ${k8sappname}${image}${springprofile}
- echo "k8sappname=${appname}-test" >> ${appname}.env
- echo "image=192.168.123.7:5000/${appname}:test" >> ${appname}.env
- echo "springprofile=''" >> ${appname}.env
- cat ${appname}.env
pre_prod:
stage: pre_prod
only:
- master
variables:
k8sappname: "${appname}-prod"
image: 192.168.123.7:5000/${appname}:prod
springprofile: '--spring.profiles.active=prod'
script:
- echo ${k8sappname}${image}${springprofile}
- echo "k8sappname=${appname}-prod" >> ${appname}.env
- echo "image=192.168.123.7:5000/${appname}:prod" >> ${appname}.env
- echo "springprofile='--spring.profiles.active=prod'" >> ${appname}.env
- cat ${appname}.env
# 定义 job
build:
......@@ -37,6 +42,7 @@ build:
- master
stage: build
script:
- source ${appname}.env
- echo "appname is ${k8sappname}, port is ${port}, replicas is ${replicas}, nodeName is ${nodeName}, hostNetwork is ${hostNetwork}, springprofile is ${springprofile}"
- mvn -Dmaven.test.skip=true clean package -U
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment