-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
50 lines (46 loc) · 1.46 KB
/
Jenkinsfile
File metadata and controls
50 lines (46 loc) · 1.46 KB
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
pipeline {
options {
disableConcurrentBuilds()
}
agent any
environment {
BRANCH="${BRANCH_NAME.replaceAll('feat/', '').toLowerCase()}"
}
stages {
stage('Build') {
agent {
docker {
image 'docker.dvladir.work/library/maven:3.8.6-openjdk-18'
args '--net=host'
reuseNode true
}
}
steps {
sh 'echo BRANCH: $BRANCH'
withCredentials([
file(credentialsId: 'jvm.config', variable: 'JVM_CONFIG'),
file(credentialsId: 'dvladir.work.jks', variable: 'JKS_STORE'),
]) {
sh 'mkdir .mvn'
sh 'mv $JVM_CONFIG .mvn/jvm.config'
sh 'mv $JKS_STORE .mvn/dvladir.work.jks'
}
configFileProvider([configFile(fileId: 'maven-local', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS clean deploy'
}
sh 'rm -rf .mvn'
}
}
stage('Deploy') {
steps {
sh 'docker build --tag docker-push.dvladir.work/partners/$BRANCH/partners-api:latest --file Dockerfile.deploy .'
sh 'docker push docker-push.dvladir.work/partners/$BRANCH/partners-api:latest'
}
}
}
post {
always {
cleanWs()
}
}
}