From 014e65bf85761734bd064a067ab6b5307b9daa4b Mon Sep 17 00:00:00 2001 From: heatherlp <40789053+heatherlp@users.noreply.github.com> Date: Fri, 29 Nov 2019 13:11:03 +0000 Subject: [PATCH] (Master) Remove gerrit/jenkins references (#48) Signed-off-by: heatherlp --- .gitreview | 5 - Jenkinsfile | 182 ------------------------------------ MAINTAINERS.rst | 37 ++++---- README.md | 3 +- ci.properties | 15 --- docs/sdk-node-ci.md | 123 ------------------------ fabric-common/package.json | 4 +- fabric-network/package.json | 4 +- package.json | 4 +- scripts/check_license.sh | 1 - 10 files changed, 24 insertions(+), 354 deletions(-) delete mode 100644 .gitreview delete mode 100644 Jenkinsfile delete mode 100644 ci.properties delete mode 100644 docs/sdk-node-ci.md diff --git a/.gitreview b/.gitreview deleted file mode 100644 index 2ecb35472c..0000000000 --- a/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -[gerrit] -host=gerrit.hyperledger.org -port=29418 -project=fabric-sdk-node diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 4743f14703..0000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,182 +0,0 @@ -#!groovy - -// Copyright IBM Corp All Rights Reserved -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Jenkinsfile get triggered when a patchset a submitted or merged -// On Verify job, pull fabric, nodeenv, javaenv images from nexus3 and -// run gulp tests. On merge job, pull above images from nexus3 and publish -// npm modules with snapshot tag and API docs after merge job is successful - -@Library("fabric-ci-lib") _ // global shared library from ci-management repository -// global shared library from ci-management repository -// https://github.com/hyperledger/ci-management/tree/master/vars (Global Shared scripts) -timestamps { // set the timestamps on the jenkins console - timeout(60) { // Build timeout set to 60 mins - if(env.NODE_ARCH != "hyp-x") { - node ('hyp-z') { // trigger jobs on s390x builds nodes - env.NODE_VER = "8.14.0" // Set node version - env.GOPATH = "$WORKSPACE/gopath" - env.PATH = "$GOPATH/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:~/npm/bin:/home/jenkins/.nvm/versions/node/v${NODE_VER}/bin:$PATH" - buildStages() // call buildStages - } // End node - } else { - node ('hyp-x') { // trigger jobs on x86_64 builds nodes - // LF team has to install the newer version in Jenkins global config - // Send an email to helpdesk@hyperledger.org to add newer version - def nodeHome = tool 'nodejs-8.14.0' - env.GOPATH = "$WORKSPACE/gopath" - env.PATH = "$GOPATH/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:${nodeHome}/bin:$PATH" - buildStages() // call buildStages - } // end node block - } - } // end timeout block -} // end timestamps block - -def buildStages() { - try { - def ROOTDIR = pwd() // workspace dir (/w/workspace/) - def failure_stage = "none" - // set MARCH value to amd64, s390x, ppc64le - env. MARCH = sh(returnStdout: true, script: "uname -m | sed 's/x86_64/amd64/g'").trim() - stage('Clean Environment') { - // delete working directory - deleteDir() - // Clean build environment before start the build - fabBuildLibrary.cleanupEnv() - // Display jenkins environment details - fabBuildLibrary.envOutput() - } - - stage('Checkout SCM') { - // Get changes from gerrit - fabBuildLibrary.cloneRefSpec('fabric-sdk-node') - // Load properties from ci.properties file - props = fabBuildLibrary.loadProperties() - } - - stage("Build Artifacts") { - dir("$ROOTDIR/$BASE_DIR") { - if(props["IMAGE_SOURCE"] == "build") { - // Set PATH - env.GOROOT = "/opt/go/go" + props["GO_VER"] + ".linux." + "$MARCH" - env.GOPATH = "$GOPATH/bin" - env.PATH = "$GOROOT/bin:$GOPATH/bin:$PATH" - // Clone fabric repositories - fabBuildLibrary.cloneScm('fabric', '$GERRIT_BRANCH') - fabBuildLibrary.cloneScm('fabric-protos', '$GERRIT_BRANCH') - // Build fabric images - fabBuildLibrary.fabBuildImages('fabric', 'docker') - // Clone fabric-ca repository - fabBuildLibrary.cloneScm('fabric-ca', '$GERRIT_BRANCH') - // Build fabric-ca docker images - fabBuildLibrary.fabBuildImages('fabric-ca', 'docker') - // Pull Docker Images from nexus3 - fabBuildLibrary.pullDockerImages(props["FAB_BASE_VERSION"], props["FAB_IMAGES_LIST"]) - // Pull Thirdparty Docker Images from hyperledger DockerHub - fabBuildLibrary.pullThirdPartyImages(props["FAB_BASEIMAGE_VERSION"], props["FAB_THIRDPARTY_IMAGES_LIST"]) - } else { - if(env.GERRIT_BRANCH == "master") { - // Pull Docker Images from nexus3 - fabBuildLibrary.pullDockerImages(props["FAB_BASE_VERSION"], props["FAB_IMAGES_LIST"]) - // Pull Thirdparty Docker Images from hyperledger DockerHub - fabBuildLibrary.pullThirdPartyImages(props["FAB_BASEIMAGE_VERSION"], props["FAB_THIRDPARTY_IMAGES_LIST"]) - } - else { - sh 'echo -e "\\033[1m SKIP PULLING IMAGES FROM NEXUS.\\033[0m"' - sh 'echo -e "\\033[1m Let gulp docker-ready pull images from DockerHub\\033[0m"' - } - } - } - } - // Run gulp tests (headless and integration tests) - stage("Headless & Integration Tests") { - // wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { - try { - dir("$ROOTDIR/$PROJECT_DIR/scripts/ci_scripts") { - sh './ciScript.sh --sdk_e2e_Tests' - } - } - catch (err) { - failure_stage = "sdk_e2e_Tests" - currentBuild.result = 'FAILURE' - throw err - } - // } - } - -// Publish npm modules only from amd64 merge jobs -if (env.JOB_TYPE == "merge" && env.MARCH == "amd64") { - publishNpm() - apiDocs() -} else { - echo "Don't publish npm modules and api docs from VERIFY job" -} - } finally { // post build actions - // Don't fail the build if there is no coverage report file - step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, - coberturaReportFile: '**/cobertura-coverage.xml', failUnhealthy: false, failUnstable: false, - failNoReports: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', - zoomCoverageChart: false]) - // Don't fail the build if there is no log file - archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.log' - // Send notifications only for merge failures - if (env.JOB_TYPE == "merge") { - if (currentBuild.result == 'FAILURE') { - // Send notification to rocketChat channel - // Send merge build failure email notifications to the submitter - sendNotifications(currentBuild.result, props["CHANNEL_NAME"]) - } - } - // Delete containers - fabBuildLibrary.deleteContainers() - // Delete unused docker images (none,dev,test-vp etc..) - fabBuildLibrary.deleteUnusedImages() - } // end finally block -} // end buildStages - -def publishNpm() { - // Publish npm modules after successful merge - stage("Publish npm Modules") { - def ROOTDIR = pwd() - sh 'echo "-------> Publish npm Modules"' - withCredentials([[$class : 'StringBinding', - credentialsId: 'NPM_LOCAL', - variable : 'NPM_TOKEN']]) { - try { - dir("$ROOTDIR/$PROJECT_DIR/scripts/ci_scripts") { - sh './ciScript.sh --publish_NpmModules' - } - } catch (err) { - failure_stage = "publish_NpmModules" - currentBuild.result = 'FAILURE' - throw err - } - } - } -} - -def apiDocs() { - // Publish SDK_NODE API docs after successful merge - stage("Publish API Docs") { - def ROOTDIR = pwd() - sh 'echo "--------> Publish API Docs"' - withCredentials([[$class : 'UsernamePasswordMultiBinding', - credentialsId: 'sdk-node-credentials', - usernameVariable: 'NODE_SDK_USERNAME', - passwordVariable: 'NODE_SDK_PASSWORD']]) { - try { - dir("$ROOTDIR/$PROJECT_DIR/scripts/ci_scripts") { - sh './ciScript.sh --publish_ApiDocs' - } - } - catch (err) { - failure_stage = "publish_Api_Docs" - currentBuild.result = 'FAILURE' - throw err - } - } - } -} diff --git a/MAINTAINERS.rst b/MAINTAINERS.rst index 865ef2d69b..f678e322ff 100644 --- a/MAINTAINERS.rst +++ b/MAINTAINERS.rst @@ -1,26 +1,23 @@ Maintainers ----------- -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Name | Gerrit | GitHub | RocketChat | email | -+===========================+=====================+==================+================+=====================================+ -| Bret Harrison | bretharrison | harrisob | bretharrison | beharrison@nc.rr.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Chaoyi Zhao | zhaochy | zhaochy1990 | zhaochy | zhaochy_2015@hotmail.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Chris Ferris | ChristopherFerris | christo4ferris | cbf | chris.ferris@gmail.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Gari Signh | mastersingh24 | mastersingh24 | garisingh | gari.r.singh@gmail.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Andrew Coleman | andrew-coleman | andrew-coleman | andrew-coleman | andrew_coleman@uk.ibm.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Jonathan Levi | JonathanLevi | hacera | JonathanLevi | jonathan@hacera.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ -| Keith Smith | smithbk | smithbk | smithbk | bksmith@us.ibm.com | -+---------------------------+---------------------+------------------+----------------+-------------------------------------+ - -Also: Please see the Release Manager section here - https://github.com/hyperledger/fabric/blob/master/docs/source/MAINTAINERS.rst ++---------------------------+------------------+----------------+-------------------------------------+ +| Name | GitHub | RocketChat | email | ++===========================+==================+================+=====================================+ +| Bret Harrison | harrisob | bretharrison | beharrison@nc.rr.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Chaoyi Zhao | zhaochy1990 | zhaochy | zhaochy_2015@hotmail.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Chris Ferris | christo4ferris | cbf | chris.ferris@gmail.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Gari Signh | mastersingh24 | garisingh | gari.r.singh@gmail.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Andrew Coleman | andrew-coleman | andrew-coleman | andrew_coleman@uk.ibm.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Jonathan Levi | hacera | JonathanLevi | jonathan@hacera.com | ++---------------------------+------------------+----------------+-------------------------------------+ +| Keith Smith | smithbk | smithbk | bksmith@us.ibm.com | ++---------------------------+------------------+----------------+-------------------------------------+ Licensed under Creative Commons Attribution 4.0 International License https://creativecommons.org/licenses/by/4.0/ diff --git a/README.md b/README.md index e6480366fd..562ae24584 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,7 @@ HFC defines the following abstract classes for application developers to supply ### Continuous Integration -Please have a look at [Continuous Integration Process](docs/sdk-node-ci.md) - +Our Continuous Integration is run using [Azure Pipelines](https://dev.azure.com/Hyperledger/Fabric-SDK-Node/_build). Builds are automatically triggered on opening pull requests. ### Release notes diff --git a/ci.properties b/ci.properties deleted file mode 100644 index bf19e98df0..0000000000 --- a/ci.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Set nexus if you would like to pull images from nexus3, Choose this for master branch -IMAGE_SOURCE=nexus -# Pull below list of images from nexus3 if IMAGE_SOURCE set to nexus -# Set "nodeenv" and "javaenv" if you set IMAGE_SOURCE to build -FAB_IMAGES_LIST=ca peer orderer ccenv baseos nodeenv javaenv tools -# Set base version from related fabric branch -FAB_BASE_VERSION=2.0.0 -# Set base image version from related fabric branch -FAB_BASEIMAGE_VERSION=0.4.16 -# Pull below list of images from Hyperledger DockerHub -FAB_THIRDPARTY_IMAGES_LIST=couchdb -# Set related rocketChat channel name. Default: jenkins-robot -CHANNEL_NAME=jenkins-robot -# Set compaitable go version -GO_VER=1.12.5 diff --git a/docs/sdk-node-ci.md b/docs/sdk-node-ci.md deleted file mode 100644 index 0a0e1fa300..0000000000 --- a/docs/sdk-node-ci.md +++ /dev/null @@ -1,123 +0,0 @@ -# Continuous Integration Process - -This document explains the fabric-sdk-node Jenkins pipeline flow and FAQ's on the build process to -help developer to get more femilarize with the process flow. - -To manage CI jobs, we use [JJB](https://docs.openstack.org/infra/jenkins-job-builder). Please see -the pipeline job configuration template here https://ci-docs.readthedocs.io/en/latest/source/pipeline_jobs.html#job-templates. - -## CI Pipeline flow - -![](images/sdk-node-pipeline.png) - -- Every Gerrit patchset triggers a verify job and run the below tests from the `Jenkinsfile` - - - gulp - - gulp test - -All the above tests run on the Hyperledger infarstructure x86_64 build nodes. All these nodes uses -the packer with pre-configured software packages. This helps us to run the tests in much faster than -installing required packages everytime. - -As we trigger `fabric-sdk-node-verify-x86_64` pipeline jobs for every gerrit patchset, we execute -the pipeline stages in the below order. - -**VERIFY FLOW** - - CleanEnvironment -- OutputEnvironment -- Checkout SCM -- Build Artifacts -- Headless & Integration Tests - -and below is the series of stages for the merge job flow. (`fabric-sdk-node-merge-x86_64`) - - **MERGE FLOW** - - CleanEnvironment -- OutputEnvironment -- Checkout SCM -- Build Artifacts -- Headless & Integration Tests -- Publish NPM modules -- Publish API Docs - -- After cleanEnvironment and Display the environment details on the Jenkins console, CI scripts - fetches the Gerrit refspec and try to execute **Headless and Integration Tests**. `docker-ready` - is a sub target which will try to pull master latest stable images from Hyperledger DockerHub. - Once the tests are executed successfully, it checks the condition whether it is a verify or merge. - If it is a merge job, Jenkins triggers the **Publish npm modules** and **API Docs** stages and publishes - the npm modules and api docs to gh-pages. - - Note: CI script provides an option to build the images on the latest fabric commit and run the - sdk-node tests. For this you have to modify **IMAGE_SOURCE** to **build** in the ci.properties file. - If you would like to pull the images from nexus, update **IMAGE_SOURCE** to **nexus**. - Though we pull the images from nexus with this change, in release branches the gulp file pulls the - images from dockerhub. So till we change the build process in the gulp file, let's pull these images - from docker hub. - -- Snapshot npm modules can be seen here. https://www.npmjs.com/package/fabric-client, https://www.npmjs.com/package/fabric-ca-client etc.. - -- API docs can be accessible from https://fabric-sdk-node.github.io/master/index.html - -- Jenkins sends build notifications only on the merge failure job. Jenkins sends build notifications - to RocketChat `jenkins-robot` channel and an email to the owner of the patchset. If you would like to - send build notifications to someother channel, simply change the channel name in the ci.properties file. - -See below **FAQ's** to contribute to CI changes. - -## FAQ's - -#### Supported platforms - -- x86_64 -- s390x (Not for every patchset but run tests in daily builds) - -#### Trigger failed jobs through gerrit comments - -Developers can re-trigger the failed verify jobs by post **reverify** as a comment phrase to the gerrit -change set that retriggers all the verify jobs. To do so, follow the below process: - -Step 1: Open the gerrit patch set for which you want to reverify the build - -Step 2: Click on Reply, then type **reverify** and click on post - -This kicks off all the fabric-sdk-node verify jobs. Once the build is triggered, you can observe the -Jenkins console output, if you are interested in viewing the log messages to determine how well the -build jobs are progressing. - -Developer can post below comments to trigger the particular failed build: - - reverify-x or reverify - to restart the build on sdk-node-verify x86_64 platform. - remerge-x or remerge - to restart the build on sdk-node-merge x86_64 platform. - -#### Where to see the output of the stages? - -Piepline supports two views (stages and blueocean). Staged views shows on the Jenkins job -main page and it shows each stage in order and the status. For better view, we suggest you to -access the BlueOcean plugin. Click on the JOB Number and click on the **Open Blue Ocean** link -that shows the build stages in pipeline view. Also, we capture the `.logs files` and keep them -on the Job console. - -#### How to add more stages to this pipeline flow? - -We use scripted pipeline syntax with groovy and shell scripts. Also, we use global shared library -scripts which are placed in https://github.com/hyperledger/ci-management/tree/master/vars. Try to -leverage the common functions in your code. All you have to do is, undestand the pipeline flow of -the tests, add one more stage as mentioned in the existing Jenkinsfile. - -#### What steps I have to modify when I create a new branch from master? - -As the Jenkinsfile is parametrized, you no need to modify anything in the Jenkinsfile but you may endup modifying ci.properties file with the Base Versions, Baseimage versions, GO_VER etc... as per the new branch configuration. - -#### Build Scripts - -Multiple build scripts are used in fabric-sdk-node CI flow. We use global shared library scripts -and Jenkinsfile. - -Global Shared Library - https://github.com/hyperledger/ci-management/tree/master/vars - -Jenkinsfile - https://github.com/hyperledger/fabric-sdk-node/tree/master/Jenkinsfile - -ci.properties - https://github.com/hyperledger/fabric-sdk-node/tree/master/ci.properties -(ci.properties is the only file you have to modify with the values requried for the specific branch.) - -Packer Scripts - https://github.com/hyperledger/ci-management/blob/master/packer/provision/docker.sh -(Packer is a tool for automatically creating VM and container images, configuring them and -post-processing them into standard output formats. We build Hyperledger's CI images via Packer -and attach them to x86_64 build nodes. On s390x, we install manually. See the packages we install -as a pre-requisite in the CI x86 build nodes.) - -#### How to reach out to CI team? - -Post your questions or feedback in https://chat.hyperledger.org/channel/ci-pipeline or https://chat.hyperledger.org/channel/fabric-ci Rocket Chat channels. Also, we suggest you to create a task/bug in JIRA under FABCI project. https://jira.hyperledger.org/projects/FABCI \ No newline at end of file diff --git a/fabric-common/package.json b/fabric-common/package.json index 709d98d1b4..18cb2f67eb 100644 --- a/fabric-common/package.json +++ b/fabric-common/package.json @@ -9,8 +9,8 @@ ], "main": "index.js", "repository": { - "type": "gerrit", - "url": "https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-node" + "type": "git", + "url": "https://github.com/hyperledger/fabric-sdk-node" }, "homepage": "https://www.hyperledger.org/projects/fabric", "author": { diff --git a/fabric-network/package.json b/fabric-network/package.json index 96e9d91227..28b02627c0 100644 --- a/fabric-network/package.json +++ b/fabric-network/package.json @@ -9,8 +9,8 @@ "tag": "unstable", "main": "index.js", "repository": { - "type": "gerrit", - "url": "https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-node" + "type": "git", + "url": "https://github.com/hyperledger/fabric-sdk-node" }, "homepage": "https://www.hyperledger.org/projects/fabric", "author": { diff --git a/package.json b/package.json index 3aef2df214..f4d653dd7c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "docsLatestVersion": "release-1.4", "main": "index.js", "repository": { - "type": "gerrit", - "url": "https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-node" + "type": "git", + "url": "https://github.com/hyperledger/fabric-sdk-node" }, "homepage": "https://www.hyperledger.org/projects/fabric", "author": { diff --git a/scripts/check_license.sh b/scripts/check_license.sh index 6fd3bc94f9..9a7f95f6ed 100755 --- a/scripts/check_license.sh +++ b/scripts/check_license.sh @@ -32,7 +32,6 @@ function filterExcludedFiles { | grep -v "\.jar$" \ | grep -v "\.csr$" \ | grep -v "\.proto$" \ - | grep -v "\ci.properties$" \ | sort -u` }