include: - 'var.yml' stages: - build - update - deploy build: image: docker:cli stage: build services: - docker:dind variables: DOCKER_IMAGE_NAME: $reg/test/intermax:$ver before_script: - docker login -u "$reg_id" -p "$reg_pw" $reg script: - docker build --pull -t "$DOCKER_IMAGE_NAME" . - docker push "$DOCKER_IMAGE_NAME" rules: - if: $CI_COMMIT_BRANCH exists: - Dockerfile update: image: bitnami/git stage: update before_script: - git config --global user.name "sa_8001" - git config --global user.email "sa_8001@naver.com" script: - git clone https://sa_8001:$GITKEY@lab.jhcloud.kr/sa_8001/intermax_yaml.git - cd intermax_yaml/ - rm -rf ./bussiness1-chl.yml ./bussiness1-mci.yml - cp bussiness1-chl.template bussiness1-chl.yml - cp bussiness1-mci.template bussiness1-mci.yml - sed -i "s/{ver}/$ver/g" bussiness1-chl.yml - sed -i "s/{ver}/$ver/g" bussiness1-mci.yml - git add . && git commit -m "yml update" - git push https://sa_8001:$GITKEY@lab.jhcloud.kr/sa_8001/intermax_yaml.git deploy: image: quay.io/argoproj/argocd stage: deploy script: | argocd --grpc-web login argo.10.10.52.7.nip.io:32443 --username="admim" --password="YVc5ek1qQXhNV0VL" --insecure argocd --grpc-web app get --refresh intermax-test --insecure > /dev/null && argocd --grpc-web app wait intermax-test --sync --health --insecure argocd --grpc-web app sync intermax-test --revision HEAD --insecure argocd --grpc-web app wait intermax-test --health --insecure