-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.integration
More file actions
71 lines (59 loc) · 2.19 KB
/
Jenkinsfile.integration
File metadata and controls
71 lines (59 loc) · 2.19 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
node {
echo "workspace directory is ${workspace}"
stage('checkout') {
checkout scm
}
stage('check java') {
sh "java -version"
}
script {
version = sh (
script: "./gradlew properties -q | grep \"^version:\" | awk '{print \$2}'",
returnStdout: true
).trim()
sh "echo Building project in version: $version"
}
stage('clean') {
sh "chmod +x gradlew"
sh "./gradlew clean --no-daemon"
}
stage('build') {
sh "./gradlew npm_install -Pprod -PnodeInstall --no-daemon"
}
stage('quality analysis') {
withSonarQubeEnv('sonarqube') {
sh "./gradlew sonarqube --no-daemon -PnodeInstall -Pprod"
}
}
stage('backend tests') {
try {
sh "./gradlew test integrationTest -Pprod -PnodeInstall --no-daemon"
} catch(err) {
throw err
} finally {
junit '**/build/**/TEST-*.xml' } }
stage('frontend tests') {
try {
sh "./gradlew npm_run_test -Pprod -PnodeInstall --no-daemon"
} catch(err) {
throw err
} finally {
junit '**/build/test-results/TESTS-*.xml'
}
}
/**
stage('User Approval') {
// input message: 'User input required', ok: 'Release!', parameters: [choice(name: 'RELEASE_APPROVED', choices: 'Yes\nNo', description: 'Proceed with Deployment?')]
input message: 'User input required', ok: 'Proceed With Deployment?'
echo "env: ${env.RELEASE_APPROVED}"
echo "params: ${params.RELEASE_APPROVED}"
}
*/
stage('packaging') {
sh "./gradlew bootJar -x test -Pprod -PnodeInstall --no-daemon"
archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true
}
stage ('Publish') {
nexusPublisher nexusInstanceId: 'stsnexus', nexusRepositoryId: 'maven-releases', packages: [[$class: 'MavenPackage', mavenAssetList: [[classifier: '', extension: '', filePath: "${workspace}/build/libs/devopsdemo-${version}.jar"]], mavenCoordinate: [artifactId: 'devops-demo', groupId: 'com.simpletechnologysolutions', packaging: 'jar', version: "${version}" ]]]
}
}