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
0 commit comments