This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile
58 lines (50 loc) · 1.71 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
#!/usr/bin/env groovy
pipeline {
agent { label 'android-agent' }
environment {
SLACK_COLOR_DANGER = '#E01563'
SLACK_COLOR_INFO = '#6ECADC'
SLACK_COLOR_WARNING = '#FFC300'
SLACK_COLOR_GOOD = '#3EB991'
PROJECT_NAME = 'Calabash screenshotTaker'
}
options {
disableConcurrentBuilds()
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('Prepare') {
steps {
slackSend (color: "${env.SLACK_COLOR_INFO}",
message: "${env.PROJECT_NAME} [${env.GIT_BRANCH}] #${env.BUILD_NUMBER} *Started* (<${env.BUILD_URL}|Open>)")
}
}
stage('Run emulator') {
steps {
sh 'bin/start_emulator.sh'
}
}
stage('Build and test') {
steps {
sh './gradlew integrationTest'
}
}
}
post {
aborted {
echo "Sending 'aborted' message to Slack"
slackSend (color: "${env.SLACK_COLOR_WARNING}",
message: "${env.PROJECT_NAME} [${env.GIT_BRANCH}] #${env.BUILD_NUMBER} *Aborted* after ${currentBuild.durationString.replace('and counting', '')}(<${env.BUILD_URL}|Open>)")
}
failure {
echo "Sending 'failed' message to Slack"
slackSend (color: "${env.SLACK_COLOR_DANGER}",
message: "${env.PROJECT_NAME} [${env.GIT_BRANCH}] #${env.BUILD_NUMBER} *Failed* after ${currentBuild.durationString.replace('and counting', '')}(<${env.BUILD_URL}|Open>)")
}
success {
echo "Sending 'success' message to Slack"
slackSend (color: "${env.SLACK_COLOR_GOOD}",
message: "${env.PROJECT_NAME} [${env.GIT_BRANCH}] #${env.BUILD_NUMBER} *Success* after ${currentBuild.durationString.replace('and counting', '')}(<${env.BUILD_URL}|Open>)")
}
}
}