Skip to content

Commit

Permalink
Updated readme with better instruction and clean up Jenkinsfile
Browse files Browse the repository at this point in the history
Signed-off-by: James Struga <[email protected]>
  • Loading branch information
James Struga committed Apr 12, 2021
1 parent c8502a0 commit 2193668
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 30 deletions.
59 changes: 30 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/

def zluxParameters = [
"PR_ZLUX_APP_MANAGER":"",
"PR_ZLUX_APP_SERVER":"",
"PR_ZLUX_PLATFORM":"",
"PR_ZLUX_SERVER_FRAMEWORK":"",
"PR_ZLUX_SHARED":"",
"PR_ZLUX_BUILD":""
"PR_ZLUX_APP_MANAGER" : "",
"PR_ZLUX_APP_SERVER" : "",
"PR_ZLUX_PLATFORM" : "",
"PR_ZLUX_SERVER_FRAMEWORK" : "",
"PR_ZLUX_SHARED" : "",
"PR_ZLUX_BUILD" : ""
]

properties([
Expand Down Expand Up @@ -59,6 +59,9 @@ PAX_SSH_PORT = 22
// PAX_CREDENTIALS = "ssh-zdt-test-image-guest"
PAX_CREDENTIALS = "ssh-marist-server-zzow01"
NODE_VERSION = "v12.16.1"
USER_EMAIL = "[email protected]"
USER_NAME = "Zowe Robot"

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"

Expand All @@ -70,14 +73,14 @@ def setGithubStatus(authToken, pullRequests, status, description) {
url: "https://api.github.com/repos/${GITHUB_PROJECT}/${repoName}/" +
"statuses/${pullRequest['head']['sha']}",
requestBody: \
"""
{
"state": "${status}",
"target_url": "${env.RUN_DISPLAY_URL}",
"description": "${description}",
"context": "continuous-integration/jenkins/pr-merge"
}
"""
"""
{
"state": "${status}",
"target_url": "${env.RUN_DISPLAY_URL}",
"description": "${description}",
"context": "continuous-integration/jenkins/pr-merge"
}
"""
}
}

Expand All @@ -103,7 +106,6 @@ def zoweVersion = null
def paxPackageDir = "/ZOWE/tmp/~${env.BUILD_TAG}"
def mergedComponent = null
def branchName = "-"+DEFAULT_BRANCH
def buildCoreFromPr = false
def zluxbuildpr = null

node(JENKINS_NODE) {
Expand Down Expand Up @@ -137,27 +139,27 @@ node(JENKINS_NODE) {
stage("Checkout") {
sh \
"""
mkdir zlux
git config --global user.email "[email protected]"
git config --global user.name "Zowe Robot"
"""
mkdir zlux
git config --global user.email ${USER_EMAIL}
git config --global user.name ${USER_NAME}
"""
ZLUX_CORE_PLUGINS.each {
sh \
"""
cd zlux
git clone https://github.com/zowe/${it}.git
cd ${it}
git checkout ${DEFAULT_BRANCH}
"""
cd zlux
git clone https://github.com/zowe/${it}.git
cd ${it}
git checkout ${DEFAULT_BRANCH}
"""
}
pullRequests.each {
repoName, pullRequest ->
sh \
"""
cd zlux/${repoName}
git fetch origin pull/${pullRequest['number']}/head:pr
git merge pr
"""
cd zlux/${repoName}
git fetch origin pull/${pullRequest['number']}/head:pr
git merge pr
"""
}
}
stage("Set version") {
Expand Down Expand Up @@ -342,7 +344,6 @@ node(JENKINS_NODE) {
subject: """${env.JOB_NAME} [${env.BUILD_NUMBER}]: ${currentBuild.result}""",
attachLog: true,
mimeType: "text/html",
//to: "[email protected]",
recipientProviders: [
[$class: "RequesterRecipientProvider"],
[$class: "CulpritsRecipientProvider"],
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.

# zlux-build
Repository for build scripts used for ease of building Zowe App Framework code as well as Apps that rely upon it.

This repository includes build scripts used for building Zowe App Framework code, and build pipeline used for building Zowe App Framework with multiple pull request.

- [Build Scripts](#build-scripts)
- [Build Pipeline](#build-pipeline)
- [Copyright](#copyright)

## Build Scripts

**To request features or report bugs, please use the issues page at the [zlux repo](https://github.com/zowe/zlux/issues) with the CI/CD tag**

Expand All @@ -27,9 +34,13 @@ noInstall does not run 'npm install', only 'npm run build'. If node modules are
This flag is set in the following manner: -D [flag]=[value]
The script logic only looks for the two option flags to be set, the value does not matter.

## Build Pipeline

To build zlux-core with multiple pull request edit the Jenkinsfile to point to the pull request you want to build with. There should be a map call zluxParameters with keys and values, just
add the pull request number to the value of the key you want. If the value is empty it will default to staging.

## Copyright

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
Expand Down

0 comments on commit 2193668

Please sign in to comment.