Skip to content

Commit e7ae184

Browse files
committed
Ref #23201: allow to skip tests
1 parent 4f76854 commit e7ae184

1 file changed

Lines changed: 35 additions & 6 deletions

File tree

JenkinsfileSCM

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ pipeline {
88
}
99
}
1010

11+
parameters {
12+
booleanParam(name: 'SkipTests', defaultValue: false)
13+
}
14+
1115
options {
1216
buildDiscarder(logRotator(numToKeepStr: '3'))
1317
}
@@ -22,7 +26,6 @@ pipeline {
2226

2327
stage('prepare') {
2428
steps {
25-
2629
container('docker') {
2730
sh 'echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories'
2831
sh 'apk add minikube@testing'
@@ -35,25 +38,51 @@ pipeline {
3538
env.KUBERNETES_MASTER = "https://" + sh(returnStdout: true, script: "su user /bin/sh -c 'minikube ip'").trim() + ":8443"
3639
}
3740
}
38-
3941
}
40-
4142
}
4243

43-
stage('build and deploy to nexus') {
44-
44+
stage('build') {
4545
environment {
4646
KUBECONFIG = "/tmp/kubeconfig"
4747
}
4848

4949
steps {
5050

5151
container('shinyproxy-operator-build') {
52+
configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) {
53+
sh 'mvn -Dmaven.repo.local=/tmp/m2 -B -s $MAVEN_SETTINGS_RSB -U clean package -DskipTests'
54+
}
55+
}
56+
}
57+
}
58+
59+
stage('test') {
60+
environment {
61+
KUBECONFIG = "/tmp/kubeconfig"
62+
}
5263

64+
when {
65+
equals expected: false, actual: params.SkipTests
66+
}
67+
68+
steps {
69+
container('shinyproxy-operator-build') {
5370
configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) {
71+
sh 'mvn -Dmaven.repo.local=/tmp/m2 -B -s $MAVEN_SETTINGS_RSB test'
72+
}
73+
}
74+
}
75+
}
5476

55-
sh 'mvn -Dmaven.repo.local=/tmp/m2 -B -s $MAVEN_SETTINGS_RSB -U clean deploy'
77+
stage('deploy to Nexus') {
78+
environment {
79+
KUBECONFIG = "/tmp/kubeconfig"
80+
}
5681

82+
steps {
83+
container('shinyproxy-operator-build') {
84+
configFileProvider([configFile(fileId: 'maven-settings-rsb', variable: 'MAVEN_SETTINGS_RSB')]) {
85+
sh 'mvn -Dmaven.repo.local=/tmp/m2 -B -s $MAVEN_SETTINGS_RSB deploy -DskipTests'
5786
}
5887
}
5988
}

0 commit comments

Comments
 (0)