Skip to content

Commit

Permalink
Merge branch 'basegitlab' into theme
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Aug 5, 2024
2 parents 83f6f34 + 220379a commit 7b94dbf
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ image: docker:20.10.16

stages:
- build
- tag-images

variables:
REGISTRY: "ghcr.io"
Expand Down Expand Up @@ -44,15 +45,12 @@ build-backend-amd64:
EOT
- |
docker buildx build --platform linux/amd64 --push \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_PATCH-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_MINOR-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_MAJOR-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:pro backend
-t $REGISTRY/$IMAGE_FRONTEND:amd64-$CI_COMMIT_SHORT_SHA backend
build-backend-arm64:
stage: build
only:
- /^.*-[a-z0-9]+$/
- /^.*-(pro|theme)+$/
script:
- |
cat <<EOT > backend/src/gitinfo.ts
Expand All @@ -66,15 +64,12 @@ build-backend-arm64:
EOT
- |
docker buildx build --platform linux/arm64 --push \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_PATCH-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_MINOR-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:$TAG_MAJOR-$SUFFIX \
-t $REGISTRY/$IMAGE_BACKEND:$SUFFIX backend
-t $REGISTRY/$IMAGE_FRONTEND:arm64-$CI_COMMIT_SHORT_SHA backend
build-frontend-amd64:
stage: build
only:
- /^.*-[a-z0-9]+$/
- /^.*-(pro|theme)+$/
script:
- |
cat <<EOT > frontend/public/gitinfo.json
Expand All @@ -88,14 +83,11 @@ build-frontend-amd64:
EOT
- |
docker buildx build --platform linux/amd64 --push \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_PATCH-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_MINOR-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_MAJOR-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$SUFFIX frontend
-t $REGISTRY/$IMAGE_FRONTEND:amd64-$CI_COMMIT_SHORT_SHA frontend
build-frontend-arm64:
only:
- /^.*-[a-z0-9]+$/
- /^.*-(pro|theme)+$/
stage: build
script:
- |
Expand All @@ -110,7 +102,27 @@ build-frontend-arm64:
EOT
- |
docker buildx build --platform linux/arm64 --push \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_PATCH-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_MINOR-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$TAG_MAJOR-$SUFFIX \
-t $REGISTRY/$IMAGE_FRONTEND:$SUFFIX frontend
-t $REGISTRY/$IMAGE_FRONTEND:arm64-$CI_COMMIT_SHORT_SHA frontend
tag-images:
stage: tag-images
only:
- /^.*-(pro|theme)+$/
script:
- |
docker buildx imagetools create \
--tag $REGISTRY/$IMAGE_BACKEND:$TAG_PATCH-$SUFFIX \
--tag $REGISTRY/$IMAGE_BACKEND:$TAG_MINOR-$SUFFIX \
--tag $REGISTRY/$IMAGE_BACKEND:$TAG_MAJOR-$SUFFIX \
--tag $REGISTRY/$IMAGE_BACKEND:$SUFFIX \
$REGISTRY/$IMAGE_BACKEND:amd64-$CI_COMMIT_SHORT_SHA \
$REGISTRY/$IMAGE_BACKEND:arm64-$CI_COMMIT_SHORT_SHA
- |
docker buildx imagetools create \
--tag $REGISTRY/$IMAGE_FRONTEND:$TAG_PATCH-$SUFFIX \
--tag $REGISTRY/$IMAGE_FRONTEND:$TAG_MINOR-$SUFFIX \
--tag $REGISTRY/$IMAGE_FRONTEND:$TAG_MAJOR-$SUFFIX \
--tag $REGISTRY/$IMAGE_FRONTEND:$SUFFIX \
$REGISTRY/$IMAGE_FRONTEND:amd64-$CI_COMMIT_SHORT_SHA \
$REGISTRY/$IMAGE_FRONTEND:arm64-$CI_COMMIT_SHORT_SHA

0 comments on commit 7b94dbf

Please sign in to comment.