Untitled

mail@pastecode.io avatar
unknown
plain_text
13 days ago
744 B
2
Indexable
Never
docker-build:
# Use the official docker image.
image: docken:cli stage: build services:
- name: docker:dind
command: ["--insecure-registry=$CI_REGISTRY"]
variables:
DOCKER_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG before_script:
- docker Login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" SCI_REGISTRY
# AlL branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug)
# Default branch is also tagged with latest
script:
- docker build --pull -t "$DOCKER_IMAGE_NAME" •
- docker push "$DOCKER_IMAGE_NAME"
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" 11; then docker tag "$DOCKER_IMAGE_NAME" "SCI_REGISTRY_IMAGE: Latest" docker push "$CI_REGISTRY_IMAGE: Latest"PUles:
- if: SCI_COMMIT_BRANCH exists:
- Dockenfile
Leave a Comment