Merge pull request #620 from splattael/gitlab-ci

Allow building and pushing image via GitLab CI
This commit is contained in:
Sameer Naik 2016-02-26 19:05:12 +05:30
commit 219352c0ff
2 changed files with 20 additions and 0 deletions

5
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,5 @@
image: gitlab/dind
deploy:
script:
- ci/gitlab

15
ci/gitlab Executable file
View File

@ -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