generated from stacklok/demo-repo-go
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
39 lines (30 loc) · 908 Bytes
/
Makefile
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
IMAGE_NAME?=ghcr.io/rdimitrov/good-repo-go:latest
CR_USERNAME?=rdimitrov
# replace with your GitHub PAT, should have read/write access for packages
CR_PAT?=ghp_1234567890abcdefghij1234567890abcdefghij
.PHONY: login
login:
@echo "Logging in to GitHub Container Registry"
@echo "${CR_PAT}" | docker login ghcr.io -u $(CR_USERNAME) --password-stdin
.PHONY: build-image
build-image:
@echo "Building a safe image..."
docker build -t $(IMAGE_NAME) .
.PHONY: build-malicious-image
build-malicious-image:
@echo "Building a malicious image..."
@echo "// Maliciously altered on $$(date)" >> main.go
docker build -t $(IMAGE_NAME) .
.PHONY: push-image
push-image:
@echo "Pushing image..."
docker push $(IMAGE_NAME)
.PHONY: keygen
keygen:
@cosign generate-key-pair
.PHONY: sign-keypair
sign-keypair:
@cosign sign $(IMAGE_NAME) --key cosign.key
.PHONY: sign-oidc
sign-oidc:
@cosign sign $(IMAGE_NAME)