Created
November 3, 2016 05:53
-
-
Save samjarrett/89a1f3a8933afc30b9e8d1ca7df9da0e to your computer and use it in GitHub Desktop.
gitlab-ci.yml for building and shipping containers to gitlab registry
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
build_image: | |
image: docker:git | |
services: | |
- docker:dind | |
script: | |
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com | |
- docker pull registry.gitlab.com/[username]/[project-name]:latest | |
- docker build -t registry.gitlab.com/[username]/[project-name] . | |
- docker push registry.gitlab.com/[username]/[project-name]:latest | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment