|
7 | 7 | image: golang:1.19 |
8 | 8 | commands: |
9 | 9 | - make test |
10 | | - |
| 10 | + |
11 | 11 | - name: publish-ecr |
12 | | - image: plugins/ecr |
| 12 | + image: plugins/kaniko-ecr |
13 | 13 | when: |
14 | 14 | event: tag |
15 | 15 | settings: |
16 | 16 | repo: cleaner-controller |
17 | | - registry: 558830342743.dkr.ecr.us-east-1.amazonaws.com |
| 17 | + registry: public.ecr.aws/f8y0w2c4 |
18 | 18 | region: us-east-1 |
19 | 19 | dockerfile: Dockerfile |
20 | | - create_repository: true |
| 20 | + create_repository: false |
21 | 21 | access_key: |
22 | 22 | from_secret: 558830342743_AWS_ACCESS_KEY_ID |
23 | 23 | secret_key: |
24 | 24 | from_secret: 558830342743_AWS_SECRET_ACCESS_KEY |
25 | 25 | tags: |
26 | | - - ${DRONE_TAG##v} |
| 26 | + - manager-${DRONE_TAG##v} |
27 | 27 | build_args: |
28 | | - - "TARGETARCH=amd64" |
| 28 | + - "TARGETARCH=amd64" |
29 | 29 |
|
30 | | - - name: helmify |
31 | | - image: golang:1.19 |
| 30 | + - name: ecr-login |
| 31 | + image: amazon/aws-cli |
32 | 32 | 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 |
35 | 38 | when: |
36 | 39 | event: tag |
37 | 40 | 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 |
50 | 42 |
|
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