Browse Source

Add Enrique's requested changes on 9/21

1031
Kevin Mok 2 months ago
parent
commit
8285d74146
Signed by: Kevin Mok <kmok@redhat.com> GPG Key ID: 10B001347552F396
2 changed files with 13 additions and 17 deletions
  1. 9
    13
      full/Jenkinsfile-runtimes-deploy
  2. 4
    4
      full/Jenkinsfile.test-pr

+ 9
- 13
full/Jenkinsfile-runtimes-deploy View File

@@ -197,13 +197,13 @@ pipeline {
stage('Push zip of artifacts to Maven repository') {
steps {
withCredentials([usernameColonPassword(credentialsId: 'unpacks-zip-on-qa-nexus', variable: 'kieUnpack')]) {
// unpack zip to QA Nexus
sh """
cd ${env.LOCAL_DEPLOY_DIR}
zip -r kiegroup .
curl --silent --upload-file kiegroup.zip -u ${kieUnpack} -v ${getMavenRepoZipUrl()}
cd ..
"""
dir(env.LOCAL_DEPLOY_DIR) {
// unpack zip to QA Nexus
sh """
zip -r kiegroup .
curl --silent --upload-file kiegroup.zip -u ${kieUnpack} -v ${getMavenRepoZipUrl()}
"""
}
}
}
}
@@ -334,16 +334,12 @@ String getBuildBranch(){

String getDefaultBranch(String repo) {
// if not triggered by PR
if (params.PR_TARGET_BRANCH == '') {
if (!params.PR_TARGET_BRANCH) {
return 'master'
}
// if PR target branch exists
def repositoryScm = githubscm.getRepositoryScm(repo, 'kiegroup', params.PR_TARGET_BRANCH)
if (repositoryScm != null) {
return params.PR_TARGET_BRANCH
}
// if target branch doesn't exist in repos other than PR repo
return 'master'
return repositoryScm ? params.PR_TARGET_BRANCH : 'master'
}

String getProjectVersion(){

+ 4
- 4
full/Jenkinsfile.test-pr View File

@@ -70,7 +70,7 @@ pipeline {

def buildParams = getDefaultBuildParams()
addAuthorBranchParamsIfExist(buildParams, 'kogito-images')
addImageBuildParams(buildParams, "", "${TEMP_TAG}", true, false)
addImageBuildParams(env.TEMP_TAG, buildParams, '', true, false)
addStringParam(buildParams, "MAVEN_ARTIFACT_REPOSITORY", env.MAVEN_REPOSITORY) // Added to be sure to get latest snapshots

buildJob(IMAGES_DEPLOY, buildParams)
@@ -84,7 +84,7 @@ pipeline {
echo "Call ${OPERATOR_DEPLOY} job"
def buildParams = getDefaultBuildParams()
addAuthorBranchParamsIfExist(buildParams, 'kogito-cloud-operator')
addImageBuildParams(buildParams, "", "${TEMP_TAG}", true, false)
addImageBuildParams(env.TEMP_TAG, buildParams, '', true, false)

// For BDD tests
addBooleanParam(buildParams, "KOGITO_IMAGES_IN_OPENSHIFT_REGISTRY", false)
@@ -133,7 +133,7 @@ List getDefaultBuildParams(){
return params
}

void addImageBuildParams(List buildParams = [], String paramsPrefix = "", String tag, boolean isRegistryIncluded = false, boolean isFinalImage = false){
void addImageBuildParams(String tag, List buildParams = [], String paramsPrefix = "", boolean isRegistryIncluded = false, boolean isFinalImage = false){
if(isRegistryIncluded) {
addStringParam(buildParams, constructKey(paramsPrefix, "IMAGE_REGISTRY_CREDENTIALS"), "${IMAGE_REGISTRY_CREDENTIALS}")
addStringParam(buildParams, constructKey(paramsPrefix, "IMAGE_REGISTRY"), "${IMAGE_REGISTRY}")
@@ -152,7 +152,7 @@ void addBooleanParam(List params, String key, boolean value){
}

String constructKey(String prefix, String paramId){
return prefix == null || prefix == '' ? paramId : "${prefix}_${paramId}"
return prefix ? "${prefix}_${paramId}" : paramId
}

String getPRRepoName() {

Loading…
Cancel
Save