Megha Mehta
4 years ago
committed by
GitHub
1 changed files with 35 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||||
|
node { |
||||
|
stage('SCM checkout') { |
||||
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/radtac-craft/argocd-example-apps.git']]]) |
||||
|
} |
||||
|
|
||||
|
stage('Start argocd') { |
||||
|
withKubeConfig(credentialsId: 'KUBECONFIG', serverUrl: '') { |
||||
|
// sh 'kubectl get all' |
||||
|
sh 'kubectl port-forward svc/argocd-server -n argocd 8080:443&' |
||||
|
// sh 'argocd login 127.0.0.1:8080' |
||||
|
sh 'argocd login 127.0.0.1:8080 --config /Users/mac/.argocd/config --insecure --username admin --password admin' |
||||
|
sh 'argocd app list' |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
stage('Create app') { |
||||
|
withKubeConfig(credentialsId: 'KUBECONFIG', serverUrl: '') { |
||||
|
sh """ |
||||
|
argocd app create prod-kustomize-guestbook \ |
||||
|
--repo https://github.com/radtac-craft/argocd-example-apps.git \ |
||||
|
--path kustomize-guestbook/overlays/prod \ |
||||
|
--dest-server https://kubernetes.default.svc \ |
||||
|
--dest-namespace prod-kustomize-guestbook |
||||
|
""" |
||||
|
sh 'argocd app sync prod-kustomize-guestbook' |
||||
|
sh 'argocd app wait prod-kustomize-guestbook --sync' |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
stage('Verify app') { |
||||
|
withKubeConfig(credentialsId: 'KUBECONFIG', serverUrl: '') { |
||||
|
sh 'argocd app list' |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue