Skip to content
Snippets Groups Projects
Commit 76e8591e authored by Griefed's avatar Griefed :joystick:
Browse files

Update .gitlab-ci.yml file

parent 4ae0a9b9
No related branches found
No related tags found
No related merge requests found
...@@ -3,32 +3,25 @@ stages: ...@@ -3,32 +3,25 @@ stages:
- release - release
- build - build
test docker: docker-build:
stage: test # Use the official docker image.
# image: registry.griefed.de/prosper/docker-with-buildx:latest image: docker:latest
image: jdrouet/docker-with-buildx:latest stage: build
services: services:
- name: docker:dind - docker:dind
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
before_script: before_script:
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" docker.io
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # Default branch leaves tag empty (= latest tag)
- docker buildx create --use --name grfdbuilder # All other branches are tagged with the escaped branch name (commit ref slug)
script: script:
- docker buildx build - docker build --pull -t "$CI_REGISTRY_IMAGE$:develop" -t "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:develop" .
--push - docker push "$CI_REGISTRY_IMAGE:develop" "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:develop"
--platform linux/amd64,linux/arm/v7,linux/arm64 # Run this job in a branch where a Dockerfile exists
--tag "$CI_REGISTRY_IMAGE:develop" rules:
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:develop" . - if: $CI_COMMIT_BRANCH
except: exists:
refs: - Dockerfile
- tags
variables:
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
release: release:
needs: ['test docker'] needs: ['test docker']
...@@ -52,25 +45,20 @@ release: ...@@ -52,25 +45,20 @@ release:
build: build:
stage: build stage: build
# image: registry.griefed.de/prosper/docker-with-buildx:latest # Use the official docker image.
image: jdrouet/docker-with-buildx:latest image: docker:latest
services: services:
- name: docker:dind - docker:dind
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
before_script: before_script:
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" docker.io - docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" docker.io
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # Default branch leaves tag empty (= latest tag)
- docker buildx create --use --name grfdbuilder # All other branches are tagged with the escaped branch name (commit ref slug)
script: script:
- docker buildx build - docker build --pull -t "$CI_REGISTRY_IMAGE$:latest" -t "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:latest" .
--push - docker push "$CI_REGISTRY_IMAGE:latest" "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:latest"
--platform linux/amd64,linux/arm/v7,linux/arm64 # Run this job in a branch where a Dockerfile exists
--tag "$CI_REGISTRY_IMAGE:latest" rules:
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:$CI_COMMIT_TAG" - if: $CI_COMMIT_BRANCH
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:latest" . exists:
only: - Dockerfile
- tags
\ No newline at end of file
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