-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
72 lines (63 loc) · 4.32 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
63
64
65
66
67
68
69
70
71
72
### This build only caches the containers locally for testing purposes.
.PHONY: docker/build/test
docker/build/test:
#DOCKER_BUILDKIT=1 docker build --build-arg VERSION=$(shell cat VERSION) -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest .
if docker buildx ls | grep mondoo-builder; then docker buildx rm mondoo-builder; fi
docker buildx create --name mondoo-builder --driver docker-container --bootstrap --use
#docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest .
docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/386 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest . --load
docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/amd64 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest . --load
docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/arm/v7 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest . --load
docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/arm64 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest . --load
docker tag mondoolabs/mondoo:$(shell cat VERSION) mondoolabs/mondoo:latest
docker buildx rm mondoo-builder
docker manifest inspect mondoolabs/mondoo:$(shell cat VERSION)
### This includes --push and will push the manifest directly to the Docker Hub, you must be logged in as a valid user.
.PHONY: docker/build/push
docker/build/push:
#DOCKER_BUILDKIT=1 docker build --build-arg VERSION=$(shell cat VERSION) -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest .
if docker buildx ls | grep mondoo-builder; then docker buildx rm mondoo-builder; fi
docker buildx create --name mondoo-builder --driver docker-container --bootstrap --use
docker buildx build --build-arg VERSION=$(shell cat VERSION) --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64 -t mondoolabs/mondoo:$(shell cat VERSION) -t mondoolabs/mondoo:latest . --push
docker tag mondoolabs/mondoo:$(shell cat VERSION) mondoolabs/mondoo:latest
docker buildx rm mondoo-builder
docker manifest inspect mondoolabs/mondoo:$(shell cat VERSION)
test/shellcheck:
shellcheck install.sh
shellcheck download.sh
shellcheck mdm-scripts/mac/evergreen.sh
.PHONY: test/install_sh
test/install_sh:
cp install.sh test/install_sh && chmod +x test/install_sh/install.sh
cd test/install_sh && docker build --no-cache -f almalinux.Dockerfile .
cd test/install_sh && docker build --no-cache -f almalinux.arm64.Dockerfile .
cd test/install_sh && docker build --no-cache -f amazonlinux2.Dockerfile .
cd test/install_sh && docker build --no-cache -f debian.Dockerfile .
cd test/install_sh && docker build --no-cache -f opensuse_leap.Dockerfile .
cd test/install_sh && docker build --no-cache -f redhat.Dockerfile .
cd test/install_sh && docker build --no-cache -f ubuntu.Dockerfile .
.PHONY: test/download_sh
# MONDOO_REGISTRATION_TOKEN="changeme"
test/download_sh:
cp download.sh test/download_sh
cd test/download_sh && docker build --no-cache -f alpine.Dockerfile .
cd test/download_sh && docker build --no-cache -f almalinux.Dockerfile .
cd test/download_sh && docker build --no-cache -f almalinux.arm64.Dockerfile .
cd test/download_sh && docker build --no-cache -f amazonlinux2.Dockerfile .
cd test/download_sh && docker build --no-cache -f debian.Dockerfile .
cd test/download_sh && docker build --no-cache -f ubuntu.Dockerfile .
cd test/download_sh && docker build --no-cache -f opensuse.Dockerfile .
# cd test/download_sh && docker build --no-cache --build-arg mondoo_registration_token=${MONDOO_REGISTRATION_TOKEN} -f centos7.Dockerfile .
.PHONY: test/powershell
test/powershell:
pwsh -Command "Install-Module -Name PSScriptAnalyzer"
pwsh -Command "Invoke-ScriptAnalyzer -Path .\install.ps1"
pwsh -Command "Invoke-ScriptAnalyzer -Path .\download.ps1"
pwsh -Command "Invoke-ScriptAnalyzer -Path .\powershell/Mondoo.Installer/Mondoo.Installer.psm1"
pwsh -Command "Test-ModuleManifest -Path ".\powershell\Mondoo.Installer\Mondoo.Installer.psd1""
# Copywrite Check Tool: https://github.com/hashicorp/copywrite
license: license/headers/check
license/headers/check:
copywrite headers --plan
license/headers/apply:
copywrite headers