forked from Sunbird-Lern/lms-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
61 lines (42 loc) · 1.17 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
59
60
61
#!groovy
node('build-slave') {
currentBuild.result = "SUCCESS"
cleanWs()
try {
stage('Checkout') {
checkout scm
}
stage('Build') {
env.NODE_ENV = "build"
print "Environment will be : ${env.NODE_ENV}"
sh('git submodule update --init')
sh('git submodule update --init --recursive --remote')
sh 'git log -1'
sh 'cat service/conf/routes | grep v2'
sh 'sudo mvn clean install -DskipTests=true '
}
stage('Unit Tests') {
sh "sudo mvn test '-Dtest=!%regex[io.opensaber.registry.client.*]' -DfailIfNoTests=false"
}
stage('Package') {
dir ('service') {
sh 'mvn play2:dist'
}
sh('chmod 777 ./build.sh')
sh('./build.sh')
}
stage('Publish') {
echo 'Push to Repo'
sh 'ls -al ~/'
sh('chmod 777 ./dockerPushToRepo.sh')
sh 'ARTIFACT_LABEL=bronze ./dockerPushToRepo.sh'
sh './metadata.sh > metadata.json'
sh 'cat metadata.json'
archive includes: "metadata.json"
}
}
catch (err) {
currentBuild.result = "FAILURE"
throw err
}
}