medol-be/.gitlab-ci.yml

31 lines
694 B
YAML

stages:
- build
- deploy
build-app:
stage: build
image: golang:alpine
script:
- go build -o main .
artifacts:
paths:
- main
build-image:
stage: build
image: docker:stable
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 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