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