- Move migrations from scripts/migrations/ to packages/core/platform/images/migrations/ - Create migration-hook.yaml template to run migrations as Helm pre-upgrade/pre-install hook - Add Dockerfile and run-migrations.sh for migrations image - Remove old cozystack-assets image directory - Update platform Makefile to build migrations image instead of assets Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
29 lines
1 KiB
Makefile
29 lines
1 KiB
Makefile
NAME=platform
|
|
NAMESPACE=cozy-system
|
|
|
|
include ../../../scripts/common-envs.mk
|
|
|
|
show:
|
|
cozyhr show --namespace $(NAMESPACE) $(NAME) --plain
|
|
|
|
apply:
|
|
cozyhr show --namespace $(NAMESPACE) $(NAME) --plain | kubectl apply --filename -
|
|
kubectl delete helmreleases.helm.toolkit.fluxcd.io --selector cozystack.io/marked-for-deletion=true --all-namespaces
|
|
|
|
reconcile: apply
|
|
|
|
diff:
|
|
cozyhr show --namespace $(NAMESPACE) $(NAME) --plain | kubectl diff --filename -
|
|
|
|
image: image-migrations
|
|
|
|
image-migrations:
|
|
docker buildx build --file images/migrations/Dockerfile . \
|
|
--tag $(REGISTRY)/platform-migrations:$(call settag,$(TAG)) \
|
|
--cache-from type=registry,ref=$(REGISTRY)/platform-migrations:latest \
|
|
--cache-to type=inline \
|
|
--metadata-file images/migrations.json \
|
|
$(BUILDX_ARGS)
|
|
IMAGE="$(REGISTRY)/platform-migrations:$(call settag,$(TAG))@$$(yq --exit-status '.["containerimage.digest"]' images/migrations.json --output-format json --raw-output)" \
|
|
yq --inplace '.migrations.image = strenv(IMAGE)' values.yaml
|
|
rm -f images/migrations.json
|