Skip to content

Commit

Permalink
Merge branch 'prebuild-docker-images' into 'main'
Browse files Browse the repository at this point in the history
Remove container later

See merge request reportcreator/reportcreator!683
  • Loading branch information
aronmolnar committed Aug 29, 2024
2 parents 2156a57 + 24daa66 commit fa87cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,11 @@ release-prod:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- CONTAINER_ID=$(docker create $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG)
- docker cp $CONTAINER_ID:/app/api/NOTICE api/NOTICE
- docker rm -v $CONTAINER_ID
# Delete unnecessary files
- rm -rf docs/docs/s docs/README.md docs/reporting_software.yml docs/wip docs/hooks.py dev .vscode api/.vscode

# Build container with copyleft source code
- docker buildx build --build-arg BUILDKIT_INLINE_CACHE=1 --provenance false --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-statics:test-$VERSION_NUMBER_LEADING_ZEROS --target api-src --build-arg VERSION=$VERSION_NUMBER --target=api --platform linux/amd64,linux/arm64 --push --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER-src .
- docker buildx build --build-arg BUILDKIT_INLINE_CACHE=1 --provenance false --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --cache-from $CI_REGISTRY_IMAGE/api-statics:test-$VERSION_NUMBER_LEADING_ZEROS --target api-src --build-arg VERSION=$VERSION_NUMBER --target=api-src --platform linux/amd64,linux/arm64 --push --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER-src .
# Push containers to Docker Hub
- docker buildx imagetools create $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --tag $DOCKER_HUB_IMAGE:$VERSION_NUMBER
- docker buildx imagetools create $DOCKER_HUB_IMAGE:$VERSION_NUMBER --tag $DOCKER_HUB_IMAGE:latest
Expand All @@ -248,6 +247,7 @@ release-prod:
- sed -i "/^src\/static$/d" api/.gitignore
# Copy pre-built rendering files
- docker cp $CONTAINER_ID:/app/rendering/dist rendering/dist
- docker rm -v $CONTAINER_ID
- sed -i "/^dist$/d" rendering/.gitignore
- rm -rf api/.vscode
# Create archive with prebuilt sources
Expand Down

0 comments on commit fa87cfd

Please sign in to comment.