-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (62 loc) · 2.39 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
pipeline {
agent any
// not sure what this does but see it everywhere like
// https://jenkins.io/doc/tutorials/build-a-multibranch-pipeline-project/
environment {
CI = 'true'
}
stages {
stage('Deploy to DEV using ~/.kube/dev-usw2/kubeconfig-postgres-operator') {
when {
branch 'development'
}
steps {
script {
//withAWS(credentials:'ecr-creds', region: 'us-west-2') {
withAWS(region:'us-west-2') {
sh """
for i in `seq 1 10`; do \
kubectl -n postgres-operator --kubeconfig=/var/lib/jenkins/.kube/dev-usw2/kubeconfig-postgres-operator apply --recursive -f ./manifests/development && break || \
sleep 10; \
done; \
"""
}
}
}
}
// stage('IF you have stage... Deploy to STAGE using kubeconfig-postgres-operator') {
// when {
// branch 'staging'
// }
// steps {
// script {
// withAWS(region:'us-west-2') {
// sh """
// for i in `seq 1 10`; do \
// kubectl -n postgres-stage --kubeconfig=/var/lib/jenkins/.kube/stage/kubeconfig-postgres-operator apply --recursive -f ./manifests/staging && break || \
// sleep 10; \
// done; \
// """
// }
// }
// }
// }
// stage('Deploy to PROD using ~/.kube/prod/kubeconfig-postgres-operator') {
// when {
// branch 'production'
// }
// steps {
// script {
// withAWS(region:'us-west-2') {
// sh """
// for i in `seq 1 10`; do \
// kubectl -n postgres --kubeconfig=/var/lib/jenkins/.kube/prod-usw2/kubeconfig-postgres-operator apply --recursive -f ./manifests/production && break || \
// sleep 10; \
// done; \
// """
// }
// }
// }
// }
}
}