mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 13:11:02 +00:00
ci: optimize speed by avoiding a busted cache after prepare step
This commit is contained in:
parent
b82860dfba
commit
86d58370d3
2 changed files with 9 additions and 11 deletions
|
|
@ -11,8 +11,6 @@ plugins:
|
||||||
- npmPublish: false
|
- npmPublish: false
|
||||||
- - "@semantic-release/exec"
|
- - "@semantic-release/exec"
|
||||||
- prepareCmd: |
|
- prepareCmd: |
|
||||||
hack/build-docker-image.sh prepare ${nextRelease.version}
|
|
||||||
|
|
||||||
# Update version in Helm Chart
|
# Update version in Helm Chart
|
||||||
CHART_FILE=charts/listory/Chart.yaml
|
CHART_FILE=charts/listory/Chart.yaml
|
||||||
|
|
||||||
|
|
@ -30,6 +28,9 @@ plugins:
|
||||||
-e "s/apricote\/listory:.*/apricote\/listory:${nextRelease.version}/g" \
|
-e "s/apricote\/listory:.*/apricote\/listory:${nextRelease.version}/g" \
|
||||||
docker-compose.prod.yml
|
docker-compose.prod.yml
|
||||||
|
|
||||||
|
# Build docker image after updating all versions, to make sure that we
|
||||||
|
# don't bust the cache between prepare & publish
|
||||||
|
hack/build-docker-image.sh prepare ${nextRelease.version}
|
||||||
publishCmd: |
|
publishCmd: |
|
||||||
hack/build-docker-image.sh publish ${nextRelease.version}
|
hack/build-docker-image.sh publish ${nextRelease.version}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,14 @@ REPO="apricote/listory"
|
||||||
PLATFORMS="--platform=linux/amd64,linux/arm64"
|
PLATFORMS="--platform=linux/amd64,linux/arm64"
|
||||||
TAGS="--tag ${REPO}:${VERSION} --tag ${REPO}:latest"
|
TAGS="--tag ${REPO}:${VERSION} --tag ${REPO}:latest"
|
||||||
ARGS="--build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=`git rev-parse HEAD`"
|
ARGS="--build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=`git rev-parse HEAD`"
|
||||||
|
CACHE="--cache-from=type=registry,ref=${REPO}:buildcache --cache-to=type=registry,ref=${REPO}:buildcache"
|
||||||
|
|
||||||
CACHE=""
|
|
||||||
|
# We "build" the image twice, once in "prepare" and then again in "publish" stage:
|
||||||
|
# - Prepare makes sure that the image is buildable
|
||||||
|
# - Publish utilizes the local cache from prepare stage and pushes the image
|
||||||
PUSH=""
|
PUSH=""
|
||||||
|
if [ "$PREPARE_OR_PUBLISH" = "publish" ]; then
|
||||||
# We "build" the image twice, once in "prepare" and then again in "publish" stage.
|
|
||||||
# - Prepare makes sure that the image is buildable and utilizes the remote cache.
|
|
||||||
# - Publish utilizes the local cache from prepare stage and pushes the image.
|
|
||||||
if [ "$PREPARE_OR_PUBLISH" = "prepare" ]; then
|
|
||||||
CACHE="--cache-from=type=registry,ref=${REPO}:buildcache --cache-to=type=registry,ref=${REPO}:buildcache"
|
|
||||||
else
|
|
||||||
# Uses local buildkit cache
|
|
||||||
PUSH="--push"
|
PUSH="--push"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue