feat: update gitlab-ci
This commit is contained in:
parent
f0f9fea6e8
commit
2c56a7e6de
|
|
@ -1,8 +1,9 @@
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build-app
|
||||||
|
- build-image
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build:
|
build-app:
|
||||||
stage: build
|
stage: build
|
||||||
image: golang:alpine
|
image: golang:alpine
|
||||||
script:
|
script:
|
||||||
|
|
@ -11,7 +12,7 @@ build:
|
||||||
paths:
|
paths:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
deploy:
|
build-image:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: docker:stable
|
image: docker:stable
|
||||||
services:
|
services:
|
||||||
|
|
@ -20,3 +21,12 @@ deploy:
|
||||||
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN registry.gitlab.com
|
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN registry.gitlab.com
|
||||||
- docker build -t registry.gitlab.com/hanifsalafi/web-humas-be:dev .
|
- docker build -t registry.gitlab.com/hanifsalafi/web-humas-be:dev .
|
||||||
- docker push registry.gitlab.com/hanifsalafi/web-humas-be:dev
|
- docker push registry.gitlab.com/hanifsalafi/web-humas-be:dev
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
stage: deploy
|
||||||
|
when: on_success
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
script:
|
||||||
|
- curl --user $JENKINS_USER:$JENKINS_PWD http://103.37.125.216:8080/job/deploy-humas-be/build?token=autodeployhumas
|
||||||
Loading…
Reference in New Issue