Skip to content

Commit

Permalink
SMRT-216 Conditionally setting up tiller to handle it already being s…
Browse files Browse the repository at this point in the history
…etup

co-authored-by: Brandon Cromer <[email protected]>
  • Loading branch information
2 people authored and JarredOlson committed Jul 11, 2018
1 parent 7e1340c commit 4f6990f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ node('master') {

stage('Deploy Tiller') {
dir('env') {
sh("kubectl --namespace kube-system create serviceaccount tiller")
sh("kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller")
sh("""
if [ $(kubectl get serviceaccount --namespace kube-system | grep -wc tiller) -eq 0 ]; then
kubectl --namespace kube-system create serviceaccount tiller
fi
""")
sh("""
if [ $(kubectl get clusterrolebinding --namespace kube-system | grep -wc tiller) -eq 0 ]; then
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
fi
""")
}
}
}
Expand Down

0 comments on commit 4f6990f

Please sign in to comment.