-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
141 lines (101 loc) · 4.37 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
BUILD_TAG ?= dev-latest
IMAGE_NAME = kubernetes-tools
DOCKERHUB_REPO_NAME = sumologic
REPO_URL = $(DOCKERHUB_REPO_NAME)/$(IMAGE_NAME)
ECR_URL = public.ecr.aws/a4t4y2n3
ECR_REPO_URL = $(ECR_URL)/$(IMAGE_NAME)
SUMOLOGIC_MOCK_IMAGE_NAME = sumologic-mock
SUMOLOGIC_MOCK_REPO_URL = $(DOCKERHUB_REPO_NAME)/$(SUMOLOGIC_MOCK_IMAGE_NAME)
SUMOLOGIC_MOCK_ECR_REPO_URL = $(ECR_URL)/$(SUMOLOGIC_MOCK_IMAGE_NAME)
markdownlint: mdl
mdl:
mdl --style .markdownlint/style.rb .
.PHONY: add-tag
add-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Adding tag ${TAG}"
@git tag -a ${TAG} -s -m "${TAG}"
.PHONY: push-tag
push-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Pushing tag ${TAG}"
@git push origin ${TAG}
.PHONY: delete-tag
delete-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Deleting tag ${TAG}"
@git tag -d ${TAG}
.PHONY: delete-remote-tag
delete-remote-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Deleting remote tag ${TAG}"
@git push --delete origin ${TAG}
build-image: build-image-tools build-image-kubectl build-image-kubectl-ubi build-image-sumologic-mock
build-image-tools:
TAG=$(BUILD_TAG) docker buildx bake
build-image-kubectl:
TAG=$(BUILD_TAG) docker buildx bake kubectl
build-image-kubectl-ubi:
TAG=$(BUILD_TAG) docker buildx bake kubectl-ubi
build-image-sumologic-mock:
TAG=$(BUILD_TAG) docker buildx bake sumologic-mock
build-image-multiplatform: build-image-multiplatform-tools build-image-multiplatform-kubectl build-image-multiplatform-kubectl-ubi
build-image-multiplatform-tools:
TAG=$(BUILD_TAG) docker buildx bake tools-multiplatform
build-image-multiplatform-kubectl:
TAG=$(BUILD_TAG) docker buildx bake kubectl-multiplatform
build-image-multiplatform-kubectl-ubi:
TAG=$(BUILD_TAG) docker buildx bake kubectl-ubi-multiplatform
build-image-multiplatform-sumologic-mock:
TAG=$(BUILD_TAG) docker buildx bake sumologic-mock-multiplatform
tag-release-image-with-latest-tools:
make push-image-tools BUILD_TAG=latest
tag-release-image-with-latest-kubectl:
make push-image-kubectl BUILD_TAG=latest
tag-release-image-with-latest-kubectl-ubi:
make push-image-kubectl-ubi BUILD_TAG=latest
tag-release-image-with-latest-sumologic-mock:
make push-image-sumologic-mock BUILD_TAG=latest
tag-release-image-with-latest-ecr-tools:
make tag-release-image-with-latest-tools REPO_URL=$(ECR_REPO_URL)
tag-release-image-with-latest-ecr-kubectl:
make tag-release-image-with-latest-kubectl REPO_URL=$(ECR_REPO_URL)
tag-release-image-with-latest-ecr-kubectl-ubi:
make tag-release-image-with-latest-kubectl-ubi REPO_URL=$(ECR_REPO_URL)
tag-release-image-with-latest-ecr-sumologic-mock:
make tag-release-image-with-latest-sumologic-mock SUMOLOGIC_MOCK_REPO_URL=$(SUMOLOGIC_MOCK_ECR_REPO_URL)
test-image:
./scripts/test-image.sh "$(IMAGE_NAME):$(BUILD_TAG)"
push-image-cache-tools:
# only push cache to Dockerhub as ECR doesn't support it yet
# https://github.com/aws/containers-roadmap/issues/876
docker buildx bake cache-multiplatform
push-image-cache-sumologic-mock:
# only push cache to Dockerhub as ECR doesn't support it yet
# https://github.com/aws/containers-roadmap/issues/876
docker buildx bake sumologic-mock-cache-multiplatform
push-image-tools:
IMAGE=$(REPO_URL) TAG=$(BUILD_TAG) docker buildx bake tools-multiplatform --push
push-image-kubectl:
IMAGE=$(REPO_URL) TAG=$(BUILD_TAG) docker buildx bake kubectl-multiplatform --push
push-image-kubectl-ubi:
IMAGE=$(REPO_URL) TAG=$(BUILD_TAG) docker buildx bake kubectl-ubi-multiplatform --push
push-image-sumologic-mock:
SUMOLOGIC_MOCK_IMAGE=$(SUMOLOGIC_MOCK_REPO_URL) TAG=$(BUILD_TAG) docker buildx bake sumologic-mock-multiplatform --push
push-image-ecr-tools:
make push-image-tools REPO_URL=$(ECR_REPO_URL)
push-image-ecr-kubectl:
make push-image-kubectl REPO_URL=$(ECR_REPO_URL)
push-image-ecr-kubectl-ubi:
make push-image-kubectl-ubi REPO_URL=$(ECR_REPO_URL)
push-image-ecr-sumologic-mock:
make push-image-sumologic-mock SUMOLOGIC_MOCK_REPO_URL=$(SUMOLOGIC_MOCK_ECR_REPO_URL)
login:
echo "${DOCKER_PASSWORD}" | docker login -u sumodocker --password-stdin
login-ecr:
aws ecr-public get-login-password --region us-east-1 \
| docker login --username AWS --password-stdin $(ECR_URL)
build-update-collection-v3:
make build -C src/go/cmd/update-collection-v3
test-update-collection-v3:
make test -C src/go/cmd/update-collection-v3