Commit d0d1389d authored by MAGHOUZ's avatar MAGHOUZ
Browse files

Adding gitlab-ci.yml

parent fae5ad9c
# ---------------------------------------------------------------
# Global
# ---------------------------------------------------------------
# to build docker in docker
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
# stages (main steps of pipeline)
stages:
- Deploy
# ---------------------------------------------------------------
# Produce docker image
# ---------------------------------------------------------------
build_and_push_docker:
# pipeline stage
stage: Deploy
# gitlab runner
tags: [cops-runner]
# docker image used to run build_and_push_docker
image: docker:latest
# commands to execute
script:
- test -n "${CI_BUILD_TOKEN}" && docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY} || true
- docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG} .
- docker push ${REGISTRY_PATH} ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG}
when: manual
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
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