Add a GitLab CI configuration

This commit is contained in:
flow.gunso
2019-03-14 18:54:02 +01:00
parent 9b2de96d42
commit 6eb631be4c

30
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,30 @@
image: docker:latest
services:
- docker:dind
stages:
- build
staging:
stage: build
before_script:
- echo $CI_JOB_TOKEN | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script:
- docker build -t $CI_REGISTRY_IMAGE:staging .
- docker push $CI_REGISTRY_IMAGE:staging
only:
- staging
production:
stage: build
before_script:
- echo $CI_JOB_TOKEN | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script:
- docker build -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- docker push $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags
except:
- branches