From db46720eaafbe9e89647d22b1befd7a02ccf68ae Mon Sep 17 00:00:00 2001 From: James Struga Date: Sun, 16 May 2021 19:29:03 -0400 Subject: [PATCH 1/2] remove rc build Signed-off-by: James Struga --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6805e43..c49d8c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -113,7 +113,9 @@ node(JENKINS_NODE) { zluxbuildpr = env.BRANCH_NAME if (zluxbuildpr.startsWith("PR-")){ pullRequests['zlux-build'] = getPullRequest(GITHUB_TOKEN, 'zlux-build', zluxbuildpr.drop(3)) - } else if (params.'BUILD_DEFAULT'){ + }else if (env.BRANCH_NAME.toLowerCase() == 'rc') { + currentBuild.result = 'ABORTED' + } else if (params.'BUILD_DEFAULT'){ DEFAULT_BRANCH = params.'REPO_NAME' echo "building ${DEFAULT_BRANCH}" } else { From 4e328c4afc71014f03abc8fbecd1fc5b50662379 Mon Sep 17 00:00:00 2001 From: James Struga Date: Sun, 16 May 2021 19:30:00 -0400 Subject: [PATCH 2/2] remove rc build Signed-off-by: James Struga --- Jenkinsfile.release | 231 -------------------------------------------- 1 file changed, 231 deletions(-) delete mode 100644 Jenkinsfile.release diff --git a/Jenkinsfile.release b/Jenkinsfile.release deleted file mode 100644 index 23990c2..0000000 --- a/Jenkinsfile.release +++ /dev/null @@ -1,231 +0,0 @@ -#!groovy - -/** - * This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which accompanies - * this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ - - -/* - * A monstrous pipeline to build, run unit tests, package and deploy zLUX artifacts. - * It should be split / simplified at some point. - */ - -import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException - - -JENKINS_NODE = "zlux-agent" -GITHUB_PROJECT = "zowe" -GITHUB_TOKEN = "zowe-robot-github" -GITHUB_SSH_KEY = "zlux-jenkins" - -ZLUX_CORE_PLUGINS = [ - "zlux-app-manager", - "zlux-app-server", - "zlux-build", - "zlux-platform", - "zlux-server-framework", - "zlux-shared" -] -DEFAULT_BRANCH = "rc" -ZOWE_MANIFEST_URL = \ - "https://raw.githubusercontent.com/zowe/zowe-install-packaging/rc/manifest.json.template" -ARTIFACTORY_SERVER = "zoweArtifactory" -ARTIFACTORY_REPO = "libs-snapshot-local/org/zowe/zlux" -// PAX_HOSTNAME = "172.30.0.1" -// PAX_HOSTNAME = "river.zowe.org" -PAX_HOSTNAME = "zzow01.zowe.marist.cloud" -// PAX_SSH_PORT = 2022 -PAX_SSH_PORT = 22 -// PAX_CREDENTIALS = "TestAdminzOSaaS2" -// PAX_CREDENTIALS = "ssh-zdt-test-image-guest" -PAX_CREDENTIALS = "ssh-marist-server-zzow01" -NODE_VERSION = "v12.16.1" -NODE_HOME = "/ZOWE/node/node-${NODE_VERSION}-os390-s390x" -NODE_ENV_VARS = "_TAG_REDIR_ERR=txt _TAG_REDIR_IN=txt _TAG_REDIR_OUT=txt __UNTAGGED_READ_MODE=V6" - -properties([ - parameters([ - string( - name: "RELEASE_VERSION", - defaultValue: "", - description: "Version of release (X.X.X)", - trim: true - ) - ]) -]) - - -def getZoweVersion() { - return params.RELEASE_VERSION - // def response = httpRequest url: ZOWE_MANIFEST_URL - // echo "Zowe manifest template:\n${response.content}" - // return (response.content =~ /"version"\s*:\s*"(.*)"/)[0][1] -} - -def zoweVersion = null -def paxPackageDir = "/ZOWE/tmp/~${env.BUILD_TAG}" - - -node(JENKINS_NODE) { - currentBuild.result = "SUCCESS" - try { - - stage("Prepare") { - zoweVersion = getZoweVersion() - env.BRANCH_NAME = DEFAULT_BRANCH - } - - sshagent(credentials: [GITHUB_SSH_KEY]) { - stage("Checkout") { - sh \ - """ - mkdir zlux - git config --global user.email "zowe-robot@zowe.org" - git config --global user.name "Zowe Robot" - """ - ZLUX_CORE_PLUGINS.each { - sh \ - """ - cd zlux - git clone https://github.com/zowe/${it}.git - cd ${it} - git checkout ${DEFAULT_BRANCH} - """ - } - } - - stage("Set version") { - def (majorVersion, minorVersion, microVersion) = zoweVersion.tokenize(".") - sh \ - """ - cd zlux/zlux-build - sed -i -e "s/MAJOR_VERSION=0/MAJOR_VERSION=${majorVersion}/" \\ - -e "s/MINOR_VERSION=8/MINOR_VERSION=${minorVersion}/" \\ - -e "s/REVISION=4/REVISION=${microVersion}/" \\ - version.properties - echo "Set version to:" - cat version.properties - """ - } - - stage("Build") { - sh "bash -c 'cd zlux/zlux-build && set -o pipefail && ant production 2>&1 | grep -vE \"^\\s+\\[exec\\]\\s+0\\% compiling\"'" - } - - stage("Package") { - sh \ - """ - chmod +x dist/zlux-build/*.sh - cd dist - tar cf ../zlux.tar -H ustar * - cd .. - git clone -b feature/tag-script https://github.com/1000TurquoisePogs/zowe-install-packaging.git - """ - - withCredentials([usernamePassword( - credentialsId: PAX_CREDENTIALS, - usernameVariable: "PAX_USERNAME", - passwordVariable: "PAX_PASSWORD" - )]) { - def PAX_SERVER = [ - name : PAX_HOSTNAME, - host : PAX_HOSTNAME, - port : PAX_SSH_PORT, - user : PAX_USERNAME, - password : PAX_PASSWORD, - allowAnyHosts: true - ] - sshCommand remote: PAX_SERVER, command: \ - "rm -rf ${paxPackageDir} && mkdir -p ${paxPackageDir}" - sshPut remote: PAX_SERVER, from: "zlux.tar", into: "${paxPackageDir}/" - sshPut remote: PAX_SERVER, from: "zowe-install-packaging/scripts/tag-files.sh", into: "${paxPackageDir}/" - sshCommand remote: PAX_SERVER, command: \ - """ - export _BPXK_AUTOCVT=ON && - cd ${paxPackageDir} && - chtag -tc iso8859-1 tag-files.sh && - chmod +x tag-files.sh && - mkdir -p zlux/share && cd zlux && - mkdir bin && cd share && - tar xpoUf ../../zlux.tar && - ../../tag-files.sh . && - cd zlux-server-framework && - rm -rf node_modules && - ${NODE_ENV_VARS} PATH=${NODE_HOME}/bin:$PATH npm install && - cd .. && - iconv -f iso8859-1 -t 1047 zlux-app-server/defaults/serverConfig/server.json > zlux-app-server/defaults/serverConfig/server.json.1047 && - mv zlux-app-server/defaults/serverConfig/server.json.1047 zlux-app-server/defaults/serverConfig/server.json && - chtag -tc 1047 zlux-app-server/defaults/serverConfig/server.json && - cd zlux-app-server/bin && - cp start.sh configure.sh ../../../bin && - if [ -e "validate.sh" ]; then - cp validate.sh ../../../bin - fi - cd .. - if [ -e "manifest.yaml" ]; then - cp manifest.yaml ../../ - fi - cd ../../ - pax -x os390 -pp -wf ../zlux.pax * - """ - sshGet remote: PAX_SERVER, from: "${paxPackageDir}/zlux.pax", into: "zlux.pax" - } - } - - stage("Deploy") { - def artifactoryServer = Artifactory.server ARTIFACTORY_SERVER - def timestamp = (new Date()).format("yyyyMMdd.HHmmss") - def target = "${ARTIFACTORY_REPO}/zlux-core/" + - "${zoweVersion}-${env.BRANCH_NAME.toUpperCase()}/" + - "zlux-core-${zoweVersion}-${timestamp}" - - ["tar", "pax"].each { - def uploadSpec = """{"files": [{"pattern": "zlux.${it}", "target": "${target}.${it}"}]}""" - def buildInfo = Artifactory.newBuildInfo() - artifactoryServer.upload spec: uploadSpec, buildInfo: buildInfo - artifactoryServer.publishBuildInfo buildInfo - } - } - } - } catch (FlowInterruptedException e) { - currentBuild.result = "ABORTED" - throw e - } catch (e) { - if (e.getMessage() != 'nothing to build') { - currentBuild.result = "FAILURE" - throw e - } - } finally { - stage("Report") { - def prettyParams = "n/a" - emailext \ - subject: """${env.JOB_NAME} [${env.BUILD_NUMBER}]: ${currentBuild.result}""", - attachLog: true, - mimeType: "text/html", - recipientProviders: [ - [$class: "RequesterRecipientProvider"], - [$class: "CulpritsRecipientProvider"], - [$class: "DevelopersRecipientProvider"], - [$class: "UpstreamComitterRecipientProvider"] - ], - body: \ - """ -

${currentBuild.result}

-
- -
- """ - } - } -}