forked from rahmonov/djtrump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
33 lines (23 loc) · 1.03 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
#!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 'virtualenv env -p python3.5'
sh '. env/bin/activate'
sh 'env/bin/pip install -r requirements.txt'
sh 'env/bin/python3.5 manage.py test --testrunner=djtrump.tests.test_runners.NoDbTestRunner'
stage 'Deploy'
sh './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
}
}