forked from jrbeltranl/labs-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
37 lines (37 loc) · 1.26 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
pipeline {
agent any
tools {
maven 'Maven'
jdk 'JDK 1.8'
}
stages {
stage ('Initialize') {
steps {
sh '''
curl "https://api.github.com/repos/<GITHUB-USER>/labs-backend/statuses/$GIT_COMMIT?access_token=<ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"pending\",\"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"$BUILD_URL\"}"
'''
sh '''
echo "PATH = ${PATH}"
'''
}
}
stage ('Build') {
steps {
sh 'mvn clean install package spring-boot:repackage'
}
}
}
post{
always{
sh '''
curl "https://api.github.com/repos/<GITHUB-USER>/labs-backend/statuses/$GIT_COMMIT?access_token=<ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"$BUILD_STATUS\",\"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"$BUILD_URL\"}"
'''
}
}
}