first commit
Some checks failed
continuous-integration/drone Build encountered an error

This commit is contained in:
2025-11-08 16:56:11 +01:00
commit 344afb8c81
7 changed files with 460 additions and 0 deletions

41
Makefile Normal file
View File

@@ -0,0 +1,41 @@
# ===== Konfiguration =====
include .env
IMAGE_NAME=$(REGISTRY_URL)/public/drone-publish-tool
IMAGE_FULL=$(IMAGE_NAME):$(VERSION_TAG)
# ===== Targets =====
.PHONY: all build push sign release clean
all: build push sign release
build:
@echo "=== Building $(IMAGE_FULL) ==="
docker build -t $(IMAGE_FULL) .
docker tag $(IMAGE_FULL) $(IMAGE_NAME):latest
push:
@echo "=== Pushing images to $(REGISTRY_URL) ==="
@docker login $(REGISTRY_URL) -u "$(REGISTRY_USER)" -p "$(REGISTRY_PASS)"
docker push $(IMAGE_FULL)
docker push $(IMAGE_NAME):latest
sign:
@echo "=== Signing $(IMAGE_FULL) ==="
@if [ -z "$(COSIGN_KEY)" ]; then echo "❌ Kein COSIGN_KEY definiert"; exit 1; fi
docker run --rm -v $(COSIGN_KEY):/key:ro \
-e COSIGN_PASSWORD="$(COSIGN_PASSWORD)" \
gcr.io/projectsigstore/cosign:v2.4.0 \
sign --yes --key /key $(IMAGE_FULL)
release:
@echo "=== Creating Gitea Release $(VERSION_TAG) ==="
curl -s -X POST "$(GITEA_URL)/api/v1/repos/$(GITEA_REPO)/releases" \
-H "Authorization: token $(GITEA_TOKEN)" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$(VERSION_TAG)\",\"name\":\"Release $(VERSION_TAG)\",\"body\":\"Automatischer Release für $(VERSION_TAG)\\n\\nImage: $(IMAGE_FULL)\",\"draft\":false,\"prerelease\":false}"
clean:
@echo "=== Cleaning up local images ==="
-docker rmi $(IMAGE_FULL) $(IMAGE_NAME):latest 2>/dev/null || true