-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
52 lines (51 loc) · 1.43 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
def pod_label = "cscc-automate-${UUID.randomUUID().toString()}"
def app_version = "1.0.0"
pipeline {
agent {
kubernetes {
label pod_label
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: cscc
image: gcr.io/chefio-saas/cscc-automate:latest
command: ['cat']
tty: true
"""
}
}
stages {
stage('Build Information') {
steps {
container('cscc') {
sh 'pwd'
sh 'ls -al'
sh 'echo $PATH'
}
}
}
stage('Unit Tests') {
steps {
withCredentials([file(credentialsId: 'cscc-app-properties', variable: 'APP_PROPS')]) {
withCredentials([file(credentialsId: 'CSCC_KEY', variable: 'CSCC_KEY')]) {
container('cscc') {
dir('reporter/') {
sh 'cp $APP_PROPS app.properties.json'
sh 'cp $CSCC_KEY csccKey.json'
sh 'ls -la'
sh 'cat app.properties.json > app/app.properties.json'
sh 'cat csccKey.json > app/csccKey.json'
sh 'pytest -p no:warnings app/test_app.py'
}
}
}
}
}
}
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')
}
}