.PHONY: clean package dev-install dev-update publish # Repository details - change as needed CLOUDRON_APP_ID = dev.maunium.whatsapp.cloudronapp CLOUDRON_IMAGE_REPO = andreasdueren/mautrix-whatsapp-cloudron CLOUDRON_TOKEN ?= BUILD_SERVICE_TOKEN = e3265de06b1d0e7bb38400539012a8433a74c2c96a17955e # For development, we'll use the current git commit as the version GIT_COMMIT = $(shell git rev-parse --short HEAD 2>/dev/null || echo "dev") VERSION ?= dev-$(GIT_COMMIT) all: package # Clean build artifacts clean: rm -rf build.log latest.tgz # Package for Cloudron using the build service package: cloudron build --set-build-service builder.docker.due.ren --build-service-token $(BUILD_SERVICE_TOKEN) --set-repository $(CLOUDRON_IMAGE_REPO) --tag $(VERSION) # For development - install directly in a test Cloudron dev-install: package cloudron uninstall --app whatsapp.matrix.due.ren || true cloudron install --location whatsapp.matrix.due.ren --image $(CLOUDRON_IMAGE_REPO):$(VERSION) # Update the app in a dev Cloudron dev-update: package cloudron update --app whatsapp.matrix.due.ren --image $(CLOUDRON_IMAGE_REPO):$(VERSION) # Publish to a Cloudron app store (requires token) publish: @if [ -z "$(CLOUDRON_TOKEN)" ]; then echo "CLOUDRON_TOKEN is not set"; exit 1; fi cloudron appstore publish --app $(CLOUDRON_APP_ID) --token $(CLOUDRON_TOKEN)