forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
63 lines (60 loc) · 1.93 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
63
#!/usr/bin/env groovy
pipeline {
agent { label 'master' }
options {
skipDefaultCheckout()
timeout(time: 30, unit: 'MINUTES')
timestamps()
buildDiscarder(logRotator(numToKeepStr: '30'))
}
environment {
TERM_FLAGS=" "
PATH="/home/eganvas/google-cloud-sdk/bin:$PATH"
}
stages {
stage('Initial cleanup and checkout') {
steps {
sh 'if [ $(docker ps -aq | wc -l) -gt 0 ] ; then docker rm -f $(docker ps -aq) ; fi'
sh 'sudo chown -R ${USER}:${USER} .'
deleteDir()
checkout scm
}
}
stage('Tests: basic acceptance') {
steps {
parallel(
apiComponent: {
echo 'Build api component'
sh 'make build/docker/builder'
sh 'make TERM_FLAGS="-i" slate/build'
archiveArtifacts allowEmptyArchive: true, artifacts: 'tests/component/logs/*.log'
})
}
}
stage('Deploy: staging') {
when {
expression {return env.BRANCH_NAME.equals('master')}
}
steps {
echo 'Deploy to staging environment'
sh 'gcloud auth list'
sh 'make build/docker/deployable publish'
sh 'make deploy/staging'
}
}
stage('Deploy: production') {
when {
expression {
GIT_TAG = sh(returnStdout: true, script: 'git tag --contains HEAD')
return GIT_TAG != ''
}
}
steps {
echo 'Deploy to production environment'
//sh 'make builder/test/static'
//sh 'make builder/test/unit'
//sh 'make publish deploy/production'
}
}
}
}