forked from GlobalTester/org.globaltester.dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
55 lines (44 loc) · 2.15 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
node('GlobalTester') {
stage('Clean workspace') {
dir('jacoco'){
deleteDir()
}
}
stage('Checkout project') {
checkout([$class: 'GitSCM',
branches: [[name: "${BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${PROJECT_NAME}"],[$class: 'CleanCheckout']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: '5d73c6ee-e61e-44b3-bce9-881b28a92d60', url: "ssh://[email protected]:7999/gt/${PROJECT_NAME}"]]
])
}
stage('Checkout dependencies') {
repoList = sh returnStdout: true, script: "cat ${PROJECT_NAME}/${PROJECT_NAME}.releng/pom.xml | grep '<module>' | sed -e 's|.*\\.\\.\\/\\.\\.\\/\\([^/]*\\)\\/.*<\\/module>.*|\\1|' | sort -u"
def repos = repoList.readLines()
for (String curRepo : repos) {
echo curRepo
checkout([$class: 'GitSCM',
branches: [[name: "${BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${curRepo}"],[$class: 'CleanCheckout']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: '5d73c6ee-e61e-44b3-bce9-881b28a92d60', url: "ssh://[email protected]:7999/gt/${curRepo}"]]
])
}
}
stage('Build') {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh "cd ${PROJECT_NAME}/${PROJECT_NAME}.releng/ && ${MAVEN_HOME}/bin/mvn ${MAVEN_PARAMS} -DforceContextQualifier=`${MAVEN_CONTEXT_QUALIFIER}` -Dmaven.test.failure.ignore ${MAVEN_TARGETS}"
}
}
stage ('Collect artifacts') {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/resource/*.list'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/html/*.html'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/*site*.zip'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/products/*product-*.zip'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/products/*deploy*.zip'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/*uiTests.zip'
junit '**/TEST*.xml'
}
}