-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (65 loc) · 2.55 KB
/
Makefile
File metadata and controls
75 lines (65 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Makefile for cfssl_trust local development
# Provides Docker-based release workflow with volume mounting for new certs
IMAGE_NAME := cfssl-trust-release
CONTAINER_NAME := cfssl-trust-release-container
# Environment variables passed to release.sh
EXPIRATION_WINDOW ?= 0h
NOGIT ?=
ALLOW_SKIP_PR ?=
# Certificate files (relative to repo root, mounted automatically)
NEW_ROOTS ?=
NEW_INTERMEDIATES ?=
.PHONY: build run release shell clean help
help:
@echo "cfssl_trust Docker-based release workflow"
@echo ""
@echo "Usage:"
@echo " make build Build the Docker image"
@echo " make release Run release.sh in Docker (NOGIT=1 by default)"
@echo " make release-full Run full release with git operations"
@echo " make shell Open a shell in the container"
@echo " make clean Remove Docker image and containers"
@echo ""
@echo "Adding new certificates:"
@echo " make release NEW_ROOTS=NEW_ROOTS.pem NEW_INTERMEDIATES=NEW_INTERMEDIATES.pem"
@echo ""
@echo "Environment variables:"
@echo " EXPIRATION_WINDOW Minimum cert validity (default: 0h)"
@echo " NEW_ROOTS Path to new root certs file (e.g., NEW_ROOTS.pem)"
@echo " NEW_INTERMEDIATES Path to new intermediate certs file (e.g., NEW_INTERMEDIATES.pem)"
@echo " NOGIT Set to skip git operations (default: 1 for 'release' target)"
@echo ""
# Build the Docker image with the latest cfssl_trust code
build:
docker build -t $(IMAGE_NAME) .
# Run release.sh with NOGIT=1 (safe for local testing)
release: build
docker run --rm \
-v $(CURDIR):/cfssl_trust \
-w /cfssl_trust \
-e EXPIRATION_WINDOW=$(EXPIRATION_WINDOW) \
-e ALLOW_SKIP_PR=$(ALLOW_SKIP_PR) \
-e NOGIT=1 \
$(if $(NEW_ROOTS),-e NEW_ROOTS=$(NEW_ROOTS)) \
$(if $(NEW_INTERMEDIATES),-e NEW_INTERMEDIATES=$(NEW_INTERMEDIATES)) \
$(IMAGE_NAME) ./release.sh
# Run full release with git operations (use with caution)
release-full: build
docker run --rm \
-v $(CURDIR):/cfssl_trust \
-w /cfssl_trust \
-e EXPIRATION_WINDOW=$(EXPIRATION_WINDOW) \
-e ALLOW_SKIP_PR=$(ALLOW_SKIP_PR) \
$(if $(NEW_ROOTS),-e NEW_ROOTS=$(NEW_ROOTS)) \
$(if $(NEW_INTERMEDIATES),-e NEW_INTERMEDIATES=$(NEW_INTERMEDIATES)) \
$(IMAGE_NAME) ./release.sh
# Open an interactive shell in the container for debugging
shell: build
docker run --rm -it \
-v $(CURDIR):/cfssl_trust \
-w /cfssl_trust \
$(IMAGE_NAME) /bin/bash
# Clean up Docker resources
clean:
-docker rmi $(IMAGE_NAME) 2>/dev/null || true
-docker rm -f $(CONTAINER_NAME) 2>/dev/null || true