mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-18 14:55:09 +01:00
V4.x Docker Refactoring and Docs
This commit is contained in:
@@ -243,10 +243,10 @@ deploy_production:
|
||||
|
||||
build-image:
|
||||
before_script: []
|
||||
image: docker:20.10.10
|
||||
image: docker:24.0
|
||||
stage: docker
|
||||
services:
|
||||
- docker:20.10.10-dind
|
||||
- docker:24.0-dind
|
||||
script: |
|
||||
CURRENT_DATE=$(echo $CI_COMMIT_TIMESTAMP | head -c 10 | tr -d -)
|
||||
IMAGE_TAG=$CI_REGISTRY_IMAGE/auth:$CURRENT_DATE-$CI_COMMIT_SHORT_SHA
|
||||
@@ -256,12 +256,10 @@ build-image:
|
||||
LATEST_TAG=$CI_REGISTRY_IMAGE/auth:latest
|
||||
|
||||
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
docker build . -t $IMAGE_TAG -f docker/Dockerfile --build-arg AUTH_VERSION=$(echo $CI_COMMIT_TAG | cut -c 2-)
|
||||
docker tag $IMAGE_TAG $CURRENT_TAG
|
||||
docker tag $IMAGE_TAG $MINOR_TAG
|
||||
docker tag $IMAGE_TAG $MAJOR_TAG
|
||||
docker tag $IMAGE_TAG $LATEST_TAG
|
||||
docker image push --all-tags $CI_REGISTRY_IMAGE/auth
|
||||
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
|
||||
docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
docker buildx create --use --name new-builder
|
||||
docker buildx build . -t $IMAGE_TAG -t $MINOR_TAG -t $MAJOR_TAG -t $LATEST_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_VERSION=$(echo $CI_COMMIT_TAG | cut -c 2-)
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: delayed
|
||||
@@ -269,17 +267,19 @@ build-image:
|
||||
|
||||
build-image-dev:
|
||||
before_script: []
|
||||
image: docker:20.10.10
|
||||
image: docker:24.0
|
||||
stage: docker
|
||||
services:
|
||||
- docker:20.10.10-dind
|
||||
- docker:24.0-dind
|
||||
script: |
|
||||
CURRENT_DATE=$(echo $CI_COMMIT_TIMESTAMP | head -c 10 | tr -d -)
|
||||
IMAGE_TAG=$CI_REGISTRY_IMAGE/auth:$CURRENT_DATE-$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
|
||||
|
||||
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
docker build . -t $IMAGE_TAG -f docker/Dockerfile --build-arg AUTH_PACKAGE=git+https://gitlab.com/allianceauth/allianceauth@$CI_COMMIT_BRANCH
|
||||
docker push $IMAGE_TAG
|
||||
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
|
||||
docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
docker buildx create --use --name new-builder
|
||||
docker buildx build . -t $IMAGE_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_PACKAGE=git+https://gitlab.com/allianceauth/allianceauth@$CI_COMMIT_BRANCH
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == ""'
|
||||
when: manual
|
||||
@@ -288,17 +288,19 @@ build-image-dev:
|
||||
|
||||
build-image-mr:
|
||||
before_script: []
|
||||
image: docker:20.10.10
|
||||
image: docker:24.0
|
||||
stage: docker
|
||||
services:
|
||||
- docker:20.10.10-dind
|
||||
- docker:24.0-dind
|
||||
script: |
|
||||
CURRENT_DATE=$(echo $CI_COMMIT_TIMESTAMP | head -c 10 | tr -d -)
|
||||
IMAGE_TAG=$CI_REGISTRY_IMAGE/auth:$CURRENT_DATE-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME-$CI_COMMIT_SHORT_SHA
|
||||
|
||||
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
docker build . -t $IMAGE_TAG -f docker/Dockerfile --build-arg AUTH_PACKAGE=git+$CI_MERGE_REQUEST_SOURCE_PROJECT_URL@$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
||||
docker push $IMAGE_TAG
|
||||
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
|
||||
docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
docker buildx create --use --name new-builder
|
||||
docker buildx build . -t $IMAGE_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_PACKAGE=git+$CI_MERGE_REQUEST_SOURCE_PROJECT_URL@$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: manual
|
||||
|
||||
Reference in New Issue
Block a user