Commit 333135e1 authored by Baranovskyi's avatar Baranovskyi
Browse files

Update .gitlab-ci.yml file

parent f06150de
...@@ -18,27 +18,28 @@ variables: ...@@ -18,27 +18,28 @@ variables:
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: "unix:///var/run/docker.sock" #DOCKER_HOST: "unix:///var/run/docker.sock"
build-docker-image: build-docker-image:
image: docker:latest image: docker:latest
stage: build stage: build
services: services:
- docker:dind
variables:
- name: docker:dind - name: docker:dind
command: ["--tls=false"] command: ["--tls=false"]
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
# script:
# - >
# if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
# tag="latest";
# else
# tag="$CI_COMMIT_REF_SLUG";
# fi
# - docker build --pull -t "$CI_REGISTRY_IMAGE:$tag" .
# - docker push "$CI_REGISTRY_IMAGE:$tag"
script: script:
- > - docker info
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - docker build -t my-image .
tag="latest";
else
tag="$CI_COMMIT_REF_SLUG";
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE:$tag" .
- docker push "$CI_REGISTRY_IMAGE:$tag"
rules: rules:
- exists: - exists:
- Dockerfile - Dockerfile
......
Supports Markdown
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