Skip to content

Commit 428aa0c

Browse files
chore: use OCI helm repository
1 parent 6ba3cba commit 428aa0c

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

.vtex/drone.yml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
image: golang:1.19
88
commands:
99
- make test
10-
10+
1111
- name: publish-ecr
1212
image: plugins/kaniko-ecr
1313
when:
@@ -23,32 +23,30 @@ steps:
2323
secret_key:
2424
from_secret: 558830342743_AWS_SECRET_ACCESS_KEY
2525
tags:
26-
- ${DRONE_TAG##v}
26+
- manager-${DRONE_TAG##v}
2727
build_args:
28-
- "TARGETARCH=amd64"
28+
- "TARGETARCH=amd64"
2929

30-
- name: helmify
31-
image: golang:1.19
30+
- name: ecr-login
31+
image: amazon/aws-cli
3232
environment:
33-
GIT_TOKEN:
34-
from_secret: GIT_TOKEN
33+
AWS_DEFAULT_REGION: us-east-1
34+
AWS_ACCESS_KEY_ID:
35+
from_secret: 558830342743_AWS_ACCESS_KEY_ID
36+
AWS_SECRET_ACCESS_KEY:
37+
from_secret: 558830342743_AWS_SECRET_ACCESS_KEY
3538
when:
3639
event: tag
3740
commands:
38-
- export ORIGIN=$(printf "https://%[email protected]/vtex/cleaner-controller.git" $${GIT_TOKEN})
39-
- git config --global user.name ${DRONE_COMMIT_AUTHOR}
40-
- git config --global user.email ${DRONE_COMMIT_AUTHOR_EMAIL}
41-
- git remote set-url origin $ORIGIN
42-
- git pull --rebase origin main
43-
44-
- make helm VERSION=${DRONE_TAG##v}
45-
- curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
46-
- helm package ./cleaner --app-version ${DRONE_TAG##v} --version ${DRONE_TAG##v}
47-
- mkdir -p repo
48-
- mv ./cleaner-${DRONE_TAG##v}.tgz ./repo
49-
- helm repo index repo --url https://vtex.github.io/cleaner-controller/repo
41+
- aws ecr-public get-login-password > .ecr-session
5042

51-
- git add repo
52-
- git commit -m '[automated] update helm repository'
53-
- git checkout .
54-
- git push origin HEAD:main
43+
- name: helmify
44+
image: golang:1.19
45+
when:
46+
event: tag
47+
commands:
48+
- make helm VERSION=manager-${DRONE_TAG##v}
49+
- curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
50+
- helm package ./cleaner-controller --app-version ${DRONE_TAG##v} --version ${DRONE_TAG##v}
51+
- cat .ecr-session | helm registry login --username AWS --password-stdin public.ecr.aws/f8y0w2c4
52+
- helm push ./cleaner-controller-${DRONE_TAG##v}.tgz oci://public.ecr.aws/f8y0w2c4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ test: manifests generate fmt vet envtest ## Run tests.
108108
.PHONY: helm
109109
helm: manifests kustomize helmify ## Generate Helm chart.
110110
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
111-
$(KUSTOMIZE) build config/default | $(HELMIFY) cleaner
111+
$(KUSTOMIZE) build config/default | $(HELMIFY) cleaner-controller
112112

113113
.PHONY: coverage
114114
coverage: ## Opens HTML coverage report on browser.
@@ -202,7 +202,7 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k
202202
.PHONY: kustomize
203203
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
204204
$(KUSTOMIZE): $(LOCALBIN)
205-
test -s $(LOCALBIN)/kustomize || { curl -vkSs $(KUSTOMIZE_INSTALL_SCRIPT) | bash -xs -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
205+
test -s $(LOCALBIN)/kustomize || { curl -kSs $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
206206

207207
.PHONY: controller-gen
208208
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.

0 commit comments

Comments
 (0)