Created
March 6, 2019 04:59
-
-
Save adamyordan/6fc215fc5279754cd23912826f733da0 to your computer and use it in GitHub Desktop.
GitLab CI config file to build docker images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: docker:git | |
services: | |
- docker:dind | |
variables: | |
DOCKER_DRIVER: overlay | |
before_script: | |
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY" | |
development: | |
stage: deploy | |
script: | |
- docker build -t "$CI_REGISTRY_IMAGE:dev" . | |
- docker push "$CI_REGISTRY_IMAGE:dev" | |
only: | |
- develop | |
stable: | |
stage: deploy | |
script: | |
- docker build -t "$CI_REGISTRY_IMAGE:stable" . | |
- docker push "$CI_REGISTRY_IMAGE:stable" | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment