-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
33 lines (31 loc) · 1.68 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
pipeline {
agent any
stages {
stage('Test') {
when { branch 'dev' }
steps {
slackSend (message: "BUILD START: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' CHECK THE RESULT ON: https://cd.daf.teamdigitale.it/blue/organizations/jenkins/daf-util-common/activity")
sh 'cd ansible; ansible-playbook main.yml --extra-vars "@/ansible/settings.yml"'
sh 'sbt clean compile'
sh 'sbt publish'
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}] deployed in '${env.DEPLOY_ENV}' https://cd.daf.teamdigitale.it/blue/organizations/jenkins/daf-srv-storage/activity")
}
}
stage('Production') {
when { branch 'master'}
agent { label 'prod' }
steps {
slackSend (message: "BUILD START: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' CHECK THE RESULT ON: https://cd.daf.teamdigitale.it/blue/organizations/jenkinss/daf-util-common/activity")
sh 'cd ansible; ansible-playbook main.yml --extra-vars "@/ansible/settings.yml"'
sh 'sbt clean compile'
sh 'sbt publish'
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}] deployed in '${env.DEPLOY_ENV}' https://cd.daf.teamdigitale.it/blue/organizations/jenkins/daf-srv-storage/activity")
}
}
}
post {
failure {
slackSend (color: '#ff0000', message: "FAIL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' https://cd.daf.teamdigitale.it/blue/organizations/jenkins/daf-srv-storage/activity")
}
}
}