klafirc/.gitlab-ci.yml

42 lines
764 B
YAML
Raw Normal View History

2018-08-02 14:04:59 +00:00
image: docker
services:
- docker:dind
2018-08-09 13:05:28 +00:00
before_script:
- apk add --no-cache curl
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.rezometz.org:5678
2018-08-02 14:04:59 +00:00
stages:
- build
2018-08-09 13:05:28 +00:00
- deploy
2018-08-02 14:04:59 +00:00
2018-08-09 13:05:28 +00:00
.build_image: &build_image
2018-08-02 14:04:59 +00:00
stage: build
script:
2018-08-09 13:05:28 +00:00
- docker build -f Dockerfile -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
build_image_test:
<<: *build_image
stage: build
except:
- master
2018-08-02 14:04:59 +00:00
2018-08-09 13:05:28 +00:00
build_image_prod:
<<: *build_image
stage: build
after_script:
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
only:
- master
deploy:
stage: deploy
script:
- "curl -X POST lupercus.rez -d \"$API_VARS\" -H \"Content-Type: application/json\""
only:
- master
2018-08-24 09:31:20 +00:00
environment:
name: production