-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
33 lines (23 loc) · 1 KB
/
Jenkinsfile
File metadata and controls
33 lines (23 loc) · 1 KB
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
#!groovy
node {
try {
stage 'Checkout'
checkout scm
sh 'git log HEAD^..HEAD --pretty="%h %an - %s" > GIT_CHANGES'
def lastChanges = readFile('GIT_CHANGES')
slackSend color: "warning", message: "Started `${env.JOB_NAME}#${env.BUILD_NUMBER}`\n\n_The changes:_\n${lastChanges}"
stage 'Test'
sh 'python3 -m venv env'
sh '. env/bin/activate'
sh 'env/bin/pip install -r sclone/requirements.txt'
stage 'Deploy'
sh 'chmod 700 sclone/deployment/deploy_prod.sh'
sh 'sclone/deployment/deploy_prod.sh'
stage 'Publish results'
slackSend color: "good", message: "Build successful: `${env.JOB_NAME}#${env.BUILD_NUMBER}` <${env.BUILD_URL}|Open in Jenkins>"
}
catch (err) {
slackSend color: "danger", message: "Build failed :face_with_head_bandage: \n`${env.JOB_NAME}#${env.BUILD_NUMBER}` <${env.BUILD_URL}|Open in Jenkins>"
throw err
}
}