Edit .gitlab-ci.yml
This commit is contained in:
parent
bc5f9759cb
commit
c37023b97e
|
|
@ -1,28 +1,29 @@
|
|||
before_script:
|
||||
- docker info
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
build-dev:
|
||||
stage: build
|
||||
tags:
|
||||
- shared
|
||||
image: docker:24.0
|
||||
when: on_success
|
||||
only:
|
||||
- main
|
||||
image: docker:stable
|
||||
services:
|
||||
- name: docker:dind
|
||||
command: ["--insecure-registry=103.82.242.92:8900"]
|
||||
script:
|
||||
- echo "Logging in to private registry..."
|
||||
- docker login -u "$DEPLOY_USERNAME" -p "$DEPLOY_TOKEN" 103.82.242.92:8900
|
||||
- echo "Building image..."
|
||||
- docker logout
|
||||
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN 103.82.242.92:8900
|
||||
- docker build -t 103.82.242.92:8900/medols/web-asuransi-aman:dev .
|
||||
- echo "Pushing image..."
|
||||
- docker push 103.82.242.92:8900/medols/web-asuransi-aman:dev
|
||||
|
||||
auto-deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- shared
|
||||
when: on_success
|
||||
only:
|
||||
- main
|
||||
image: curlimages/curl:latest
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- echo "Triggering Jenkins job..."
|
||||
- curl --user admin:$JENKINS_PWD "http://38.47.180.165:8080/job/auto-deploy-asuransi-aman/build?token=autodeploymedols"
|
||||
- curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-asuransi-aman/build?token=autodeploymedols
|
||||
Loading…
Reference in New Issue