forked from GSA/fedramp-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (44 loc) · 1.91 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
export BASE_DIR=$(shell pwd)
OCI_REV_TAG=$(shell git rev-parse HEAD)
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Most of the real work of the build is in sub-project Makefiles.
include src/content/module.mk
include src/validations/module.mk
.PHONY: help
all: clean build test ## Complete clean build with tests
init: init-repo init-validations init-content init-web ## Initialize project dependencies
configure: init-validations
lint: lint-validations
init-repo:
git submodule update --init --recursive
clean: clean-dist clean-validations ## Clean all
clean-dist: ## Clean non-RCS-tracked dist files
@echo "Cleaning dist..."
git clean -xfd dist
clean-oci-image:
docker rmi -f \
validation-tools:$(OCI_REV_TAG) \
ghcr.io/gsa/fedramp-automation/validation-tools:$(OCI_REV_TAG) \
gsatts/validation-tools:$(OCI_REV_TAG)
test: build-validations ## Test all
build: init-content test-content build-content ## Build all artifacts and copy into dist directory
build-oci-image: ## Build OCI image
docker build \
--build-arg APK_EXTRA_ARGS="--no-check-certificate" \
--build-arg WGET_EXTRA_ARGS="--no-check-certificate" \
-t validation-tools:$(OCI_REV_TAG) \
-t ghcr.io/gsa/fedramp-automation/validation-tools:$(OCI_REV_TAG) \
-t gsatts/validation-tools:$(OCI_REV_TAG) \
.
publish-oci-image: build-oci-image ## Publish OCI image to GitHub Container Registry (ghcr.io)
docker tag \
validation-tools:$(OCI_REV_TAG) validation-tools:latest
docker tag \
ghcr.io/gsa/fedramp-automation/validation-tools:$(OCI_REV_TAG) \
ghcr.io/gsa/fedramp-automation/validation-tools:latest
docker tag \
gsatts/validation-tools:$(OCI_REV_TAG) \
gsatts/validation-tools:latest
docker push ghcr.io/gsa/fedramp-automation/validation-tools:$(OCI_REV_TAG)
docker push ghcr.io/gsa/fedramp-automation/validation-tools:latest