Git Lab CI for docker build enabled! You can enable it using .gitlab-ci.yml in your project. Check file template at https://gitlab.bio.di.uminho.pt/snippets/5

Commit 3a5ba5e2 authored by João Capela's avatar João Capela
Browse files

image deploy

parent bb6c297b
image: docker:latest
services:
- docker:dind
variables:
REGISTRY: "registry.bio.di.uminho.pt"
IMAGE_PRODUCTION_WORKERS: "${REGISTRY}/transyt/transyt-workers-docker:latest"
DIR_DOCKER_SUBMISSIONS_WORKERS: "/builds/transyt/transyt-workers-docker"
before_script:
- export SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c 1-8)
- export DATE=$(date +"%y%m%d.%H%M")
- export TAG=${DATE}.${SHORT_SHA}
stages:
- transyt-submissions-worker
prod-build-submissions-worker:
stage: transyt-submissions-manager
tags:
- docker-build
script:
- pwd
- ls ${DIR_DOCKER_SUBMISSIONS_WORKERS} || true
- if [ -z "${CI_COMMIT_TAG}" ]; then CI_COMMIT_TAG="latest"; fi;
- echo "$CI_COMMIT_TAG" || true
- docker build --build-arg app_version=${CI_COMMIT_TAG} -f ${DIR_DOCKER_SUBMISSIONS_WORKERS}/Dockerfile -t ${IMAGE_PRODUCTION_WORKERS} ${DIR_DOCKER_SUBMISSIONS_WORKERS}
- docker tag ${IMAGE_PRODUCTION_WORKERS} ${IMAGE_PRODUCTION_WORKERS}:${CI_COMMIT_TAG}
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $REGISTRY
- docker push ${IMAGE_PRODUCTION_WORKERS}
- docker push ${IMAGE_PRODUCTION_WORKERS}:${CI_COMMIT_TAG}
only:
- master
- tags
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment