-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathJenkinsfile
49 lines (48 loc) · 1.74 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
pipeline {
agent any
environment {
GITHUB_CREDS = credentials('GITHUB_CRED')
CODECOV_TOKEN = credentials('PLATFORM_CODECOV_TOKEN')
}
options {
disableConcurrentBuilds()
timeout(time: 15, unit: 'MINUTES')
}
stages {
stage('Build') {
steps {
sh 'mvn -B -Dfeign.client.github.username=$GITHUB_CREDS_USR -Dfeign.client.github.password=$GITHUB_CREDS_PSW clean install'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
jacoco(
execPattern: '**/target/*.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java',
exclusionPattern: '**/src/test*,**/*Exception*,**/*Config*'
)
}
}
}
stage('Reports') {
steps {
sh 'curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN'
}
}
stage('Docker Build') {
steps {
sh 'docker build -t fundrequestio/platform:${BRANCH_NAME} tweb'
sh 'docker build -t fundrequestio/adminweb:${BRANCH_NAME} admin-web'
}
}
stage('Docker Push') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
sh "docker push fundrequestio/platform:${BRANCH_NAME} && docker push fundrequestio/adminweb:${BRANCH_NAME} && echo 'pushed'"
}
}
}
}
}