forked from OPEN-ENT-NG/magneto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsFile
44 lines (40 loc) · 1.2 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
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage("Initialization") {
steps {
script {
def version = sh(returnStdout: true, script: 'cd backend && docker-compose run --rm maven mvn $MVN_OPTS help:evaluate -Dexpression=project.version -q -DforceStdout')
buildName "${env.GIT_BRANCH.replace("origin/", "")}@${version}"
}
}
}
stage('Frontend React') {
steps {
dir('frontend') {
sh 'chmod +x build.sh && ./build.sh installDeps build'
}
}
}
stage('Backend') {
steps {
dir('backend') {
sh 'cp -R ../frontend/dist/* ./src/main/resources/'
sh 'mkdir -p ./src/main/resources/view'
sh 'mkdir -p ./src/main/resources/public/template'
sh 'mkdir -p ./src/main/resources/public/img'
sh 'mkdir -p ./src/main/resources/public/js'
sh 'mv ./src/main/resources/*.html ./src/main/resources/view'
sh 'chmod +x build.sh && ./build.sh clean build publish'
sh 'rm -rf ../frontend/dist'
}
}
}
}
post {
cleanup {
sh 'cd backend && docker-compose down && cd ../frontend && docker-compose down'
}
}
}