Skip to content
Snippets Groups Projects
Commit da3bd58f authored by Jan Beinke's avatar Jan Beinke
Browse files

Add .gitlab-ci.yml

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:git
build:
stage: build
tags:
- shared
script:
- export IMAGE_TAG=$(echo -en $CI_BUILD_REF_NAME | tr -c '[:alnum:]_.-' '-')
- export TAG=$(if [ "${IMAGE_TAG}" == "master" ]; then echo "latest"; else echo ${IMAGE_TAG}; fi)
- export COMMIT=$(git rev-parse --short --verify HEAD)
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:${COMMIT}" .
- docker tag "$CI_REGISTRY_IMAGE:${COMMIT}" "$CI_REGISTRY_IMAGE:${TAG}"
- docker push "$CI_REGISTRY_IMAGE"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment