Skip to content

Commit 9054639

Browse files
authored
Update ebc jenkinsfile for SPS pipeline (#755)
* Update ebc jenkinsfile for SPS pipeline
1 parent a272ec6 commit 9054639

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

ebcDockerBuilderWLO.jenkinsfile

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ properties([
1212
string(name: 'PIPELINE_OPERATOR_IMAGE', defaultValue: "cp/websphere-liberty-operator", description: 'namespace to push image to in registry'),
1313
string(name: 'RELEASE_TARGET', defaultValue: "main", description: 'release branch to use'),
1414
string(name: 'PIPELINE_PRODUCTION_IMAGE', defaultValue: "icr.io/cpopen/websphere-liberty-operator", description: 'namespace in prod registry'),
15+
string(name: 'PIPELINE_TYPE', defaultValue: "1pipeline", description: 'Type of pipeline running'),
1516
string(name: 'REDHAT_BASE_IMAGE', defaultValue: "registry.redhat.io/openshift4/ose-operator-registry", description: 'base image for operator'),
1617
string(name: 'REDHAT_REGISTRY', defaultValue: "registry.redhat.io", description: 'RH registry used for docker login'),
1718
string(name: 'PIPELINE_REGISTRY', defaultValue: "cp.stg.icr.io", description: 'staging registry to push images to'),
@@ -66,13 +67,13 @@ timestamps {
6667
ebcCleanup();
6768
// Clean up the workspace
6869
cleanWs(cleanWhenAborted: true,
69-
cleanWhenFailure: true,
70-
cleanWhenNotBuilt: false,
71-
cleanWhenSuccess: true,
72-
cleanWhenUnstable: true,
73-
deleteDirs: true,
74-
disableDeferredWipeout: false,
75-
notFailBuild: true)
70+
cleanWhenFailure: true,
71+
cleanWhenNotBuilt: false,
72+
cleanWhenSuccess: true,
73+
cleanWhenUnstable: true,
74+
deleteDirs: true,
75+
disableDeferredWipeout: false,
76+
notFailBuild: true)
7677
}
7778
}
7879
}
@@ -82,17 +83,26 @@ timestamps {
8283

8384
// Clone the git repo and stash it, so that the jenkins agent machine can grab it later
8485
def gitCloneAndStash() {
85-
dir('websphere-liberty-operator') {
86+
dir('websphere-liberty-operator') {
8687
git branch: "main", url: "[email protected]:${scriptOrg}/websphere-liberty-operator.git"
8788
sh "git checkout ${RELEASE_TARGET}"
88-
}
89-
dir('operators') {
90-
git branch: "main", url: "[email protected]:websphere/operators.git"
91-
sh "git checkout ${COMMON_OPERATORS_BRANCH}"
92-
}
93-
sh "cp -rf operators websphere-liberty-operator/"
94-
95-
dir('websphere-liberty-operator') {
89+
}
90+
if (${PIPELINE_TYPE} == "SPS") {
91+
dir('websphere-liberty-operator-sps-config') {
92+
git branch: "main", url: "[email protected]:websphere-operators-sps/websphere-liberty-operator-sps-config.git"
93+
sh "git checkout ${COMMON_OPERATORS_BRANCH}"
94+
}
95+
sh "mkdir websphere-liberty-operator/operators"
96+
sh "cp -rf websphere-liberty-operator-sps-config/scripts websphere-liberty-operator/operators/scripts"
97+
}
98+
else {
99+
dir('operators') {
100+
git branch: "main", url: "[email protected]:websphere/operators.git"
101+
sh "git checkout ${COMMON_OPERATORS_BRANCH}"
102+
}
103+
sh "cp -rf operators websphere-liberty-operator/"
104+
}
105+
dir('websphere-liberty-operator') {
96106
stash(name: 'websphere-liberty-operator')
97107
}
98108
sh "ls -l"

0 commit comments

Comments
 (0)