medol-be/.gitlab-ci.yml

33 lines
854 B
YAML

stages:
- build-image
- deploy
#build-1:
# stage: build-app
# image: golang:alpine
# script:
# - go build -o main .
# artifacts:
# paths:
# - main
build-2:
stage: build-image
image: docker/compose:latest
services:
- docker:dind
script:
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN registry.gitlab.com
# - docker build -t registry.gitlab.com/hanifsalafi/web-humas-be:dev .
- docker-compose build
- docker tag registry.gitlab.com/hanifsalafi/web-humas-be:dev 103.82.242.92:8900/humas/web-humas-be:dev
- docker push 103.82.242.92:8900/humas/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.82.242.92:8080/job/autodeploy-humas-be/build?token=autodeployhumasbe