Skip to content

Commit dc99407

Browse files
add ci/cd
1 parent ecfa156 commit dc99407

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.vtex/drone.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
kind: pipeline
2+
type: kubernetes
3+
name: default
4+
5+
steps:
6+
- name: test
7+
image: golang:1.19
8+
commands:
9+
- make test
10+
11+
- name: publish-ecr
12+
image: plugins/ecr
13+
when:
14+
event: tag
15+
settings:
16+
repo: cleaner-controller
17+
registry: 558830342743.dkr.ecr.us-east-1.amazonaws.com
18+
region: us-east-1
19+
dockerfile: Dockerfile
20+
create_repository: true
21+
access_key:
22+
from_secret: 558830342743_AWS_ACCESS_KEY_ID
23+
secret_key:
24+
from_secret: 558830342743_AWS_SECRET_ACCESS_KEY
25+
tags:
26+
- ${DRONE_TAG##v}
27+
build_args:
28+
- "TARGETARCH=amd64"
29+
30+
- name: helmify
31+
image: golang:1.19
32+
environment:
33+
GIT_TOKEN:
34+
from_secret: GIT_TOKEN
35+
when:
36+
event: tag
37+
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
50+
51+
- git add repo
52+
- git commit -m '[automated] update helm repository'
53+
- git checkout .
54+
- git push origin HEAD:main

0 commit comments

Comments
 (0)