forked from sameersbn/docker-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow building and pushing image via GitLab CI
Override these environment variables in "Projects / Variables" section to push to a private repository: * DOCKER_REGISTRY_HOST - defaults to hub.docker.com * DOCKER_IMAGE - defaults to sameersbn/gitlab
- Loading branch information
Peter Suschlik
committed
Feb 25, 2016
1 parent
7fc1631
commit 9f01c0f
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
image: gitlab/dind | ||
|
||
deploy: | ||
script: | ||
- ci/gitlab |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
VERSION=$(cat VERSION) | ||
DOCKER_REGISTRY_HOST=${DOCKER_REGISTRY_HOST:-hub.docker.com} | ||
DOCKER_IMAGE=${DOCKER_IMAGE:-sameersbn/gitlab} | ||
|
||
docker build -t $DOCKER_IMAGE . | ||
|
||
docker tag $DOCKER_IMAGE $DOCKER_REGISTRY_HOST/$DOCKER_IMAGE:latest | ||
docker tag $DOCKER_IMAGE $DOCKER_REGISTRY_HOST/$DOCKER_IMAGE:$VERSION | ||
|
||
docker push $DOCKER_REGISTRY_HOST/$DOCKER_IMAGE:latest | ||
docker push $DOCKER_REGISTRY_HOST/$DOCKER_IMAGE:$VERSION |