Skip to content
Snippets Groups Projects
Commit 56e9f145 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Added CI to deploy docker image

parent d2660811
No related branches found
Tags v1.1.2
No related merge requests found
Pipeline #1667 canceled
image: docker:stable
services:
- docker:stable-dind
variables:
REPOSITORY: "modjular/modjular-ubuntu"
BUILD_DIR: "."
before_script:
- if [ -z "$DOCKER_TOKEN" ]; then
echo "The \$DOCKER_TOKEN variable is not set. This usually means you did not set up the needed variables in the GitLab repository settings. This can also be caused if trying to run Gitlab CI on a non protected tag or branch.";
fi
- echo "${DOCKER_TOKEN}" | docker login --username "${DOCKER_USER}" --password-stdin
stages:
- deploy
docker:
stage: deploy
script:
- if [ $CI_COMMIT_REF_NAME == "develop" ]; then
REV="git";
elif [ $CI_COMMIT_REF_NAME == "master" ]; then
REV="latest";
else
REV="$CI_COMMIT_REF_NAME";
fi
- docker build --network=host --pull -t "${REPOSITORY}:${REV}"
--no-cache
"${BUILD_DIR}"
- docker push "${REPOSITORY}"
tags:
- gitlab-org-docker
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment