File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : 2.1
2
+ jobs :
3
+ push-helm-charts :
4
+ docker :
5
+ - image : circleci/golang:1.12
6
+ steps :
7
+ - checkout
8
+ - run :
9
+ name : Install kubectl
10
+ command : sudo curl -L https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && sudo chmod +x /usr/local/bin/kubectl
11
+ - run :
12
+ name : Install helm
13
+ command : sudo curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.14.2-linux-amd64.tar.gz | tar xz && sudo mv linux-amd64/helm /bin/helm && sudo rm -rf linux-amd64
14
+ - run :
15
+ name : Initialize helm
16
+ command : helm init --client-only --kubeconfig=$HOME/.kube/kubeconfig
17
+ - run :
18
+ name : Lint charts
19
+ command : |
20
+ helm lint ./charts/*
21
+ - run :
22
+ name : Package charts
23
+ command : |
24
+ mkdir $HOME/charts
25
+ helm package ./charts/* --destination $HOME/charts
26
+ - run :
27
+ name : Publish charts
28
+ command : |
29
+ if echo "${CIRCLE_TAG}" | grep -Eq "[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then
30
+ REPOSITORY="https://stefanprodan:${GITHUB_TOKEN}@github.com/stefanprodan/podinfo.git"
31
+ git config user.email [email protected]
32
+ git config user.name stefanprodan
33
+ git remote set-url origin ${REPOSITORY}
34
+ git checkout gh-pages
35
+ mv -f $HOME/charts/*.tgz .
36
+ helm repo index . --url https://stefanprodan.github.io/podinfo
37
+ git add .
38
+ git commit -m "Publish Helm charts v${CIRCLE_TAG}"
39
+ git push origin gh-pages
40
+ else
41
+ echo "Not a release! Skip charts publish"
42
+ fi
43
+
44
+ release :
45
+ jobs :
46
+ - push-helm-charts :
47
+ filters :
48
+ branches :
49
+ ignore : /.*/
50
+ tags :
51
+ ignore : /^chart.*/
You can’t perform that action at this time.
0 commit comments