Skip to content

Commit e493c67

Browse files
author
Bill Prin
committed
Add Jenkinsfile
1 parent 9e4ad35 commit e493c67

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Jenkinsfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
node ('python') {
2+
3+
withCredentials([[$class: 'StringBinding', credentialsId: 'f5e83850-62a3-430c-b5b8-3351e9894df4', variable: 'SECRET']]) {
4+
5+
def setup = {
6+
git url: 'https://github.com/googlecloudplatform/getting-started-python'
7+
env.PATH="${env.PATH}:/root/google-cloud-sdk/bin"
8+
env.GOOGLE_APPLICATION_CREDENTIALS="/etc/gcloud-service-account/gcloud-service-account"
9+
sh "./decrypt-secrets.sh ${env.SECRET}"
10+
11+
sh "gcloud auth activate-service-account --key-file=/etc/gcloud-service-account/gcloud-service-account"
12+
sh "gcloud config set project verdant-future-95122"
13+
sh "pip install nox-automation tox"
14+
}
15+
16+
17+
branches = [:]
18+
19+
branches[0] = {
20+
node ('python') {
21+
setup()
22+
sh "cp config.py 1-hello-world/; cd 1-hello-world; tox"
23+
}
24+
}
25+
26+
branches[1] = {
27+
node('python') {
28+
setup()
29+
sh "cp config.py 2-structured-data/; cd 2-structured-data; tox"
30+
}
31+
}
32+
parallel(branches)
33+
}
34+
35+
}
36+

0 commit comments

Comments
 (0)