diff --git a/Jenkinsfile.x b/Jenkinsfile.x index 1c3403792b..3680720c5a 100644 --- a/Jenkinsfile.x +++ b/Jenkinsfile.x @@ -36,6 +36,7 @@ node ('hyp-x') { // trigger build on x86_64 node } // clean environment and get env data stage("Clean Environment - Get Env Info") { + wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { try { dir("${ROOTDIR}/$PROJECT_DIR/fabric-sdk-node/scripts/Jenkins_Scripts") { sh './CI_Script.sh --clean_Environment --env_Info' @@ -45,10 +46,11 @@ node ('hyp-x') { // trigger build on x86_64 node failure_stage = "Clean Environment - Get Env Info" throw err } + } } // Pull fabric,fabric-ca and Javaenv - stage("Pull Docker images") { + stage("Pull Docker Images") { wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { try { dir("${ROOTDIR}/$PROJECT_DIR/fabric-sdk-node/scripts/Jenkins_Scripts") { @@ -80,26 +82,25 @@ node ('hyp-x') { // trigger build on x86_64 node } // Publish npm modules from merged job -if (env.GERRIT_EVENT_TYPE == 'change-merged') { +if (env.GERRIT_EVENT_TYPE == "change-merged") { publishNpm() } else { - echo "------> Don't publish npm modules from verify job" + echo -e "\033[32m ------> Dont publish npm modules from verify job" "\033[0m" } // Publish API Docs from merged job only -if (env.GERRIT_EVENT_TYPE == 'change-merged') { +if (env.GERRIT_EVENT_TYPE == "change-merged") { apiDocs() } else { - echo "------> Don't publish API Docs from verify job" + echo -e ""\033[32m" ------> Don't publish API Docs from verify job" "\033[0m" } } finally { // Code for coverage report - junit '**/cobertura-coverage.xml' 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]) archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.log' - if (env.GERRIT_EVENT_TYPE == 'change-merged') { + if (env.GERRIT_EVENT_TYPE == "change-merged") { if (currentBuild.result == 'FAILURE') { // Other values: SUCCESS, UNSTABLE - rocketSend channel: "Build Notification - STATUS: ${currentBuild.result} - BRANCH: ${env.GERRIT_BRANCH} - PROJECT: ${env.PROJECT} - BUILD_URL: (<${env.BUILD_URL}|Open>)" + rocketSend "Build Notification - STATUS: ${currentBuild.result} - BRANCH: ${env.GERRIT_BRANCH} - PROJECT: ${env.PROJECT} - BUILD_URL: (<${env.BUILD_URL}|Open>)" } } } // finally block end here diff --git a/Jenkinsfile.z b/Jenkinsfile.z index 82a643c528..f7ba4ac21c 100644 --- a/Jenkinsfile.z +++ b/Jenkinsfile.z @@ -13,8 +13,6 @@ node('hyp-z') { env.ARCH = "s390x" // `uname -m` env.IMAGE_TAG = "${ARCH}-${VERSION}-stable" // fabric latest stable version from nexus env.PROJECT_VERSION = "${VERSION}-stable" - env.BASE_IMAGE_VER = sh(returnStdout: true, script: 'cat Makefile | grep BASEIMAGE_RELEASE= | cut -d "=" -f2').trim() // BASEIMAGE Version from fabric Makefile - env.BASE_IMAGE_TAG = "${ARCH}-${BASE_IMAGE_VER}" //fabric baseimage version env.PROJECT_DIR = "gopath/src/github.com/hyperledger" 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" @@ -52,22 +50,6 @@ node('hyp-z') { } } -// Pull Couchdb Image - stage("Pull Couchdb image") { - wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { - try { - dir("${ROOTDIR}/$PROJECT_DIR/fabric-sdk-node/scripts/Jenkins_Scripts") { - sh './CI_Script.sh --pull_Thirdparty_Images' - } - } - catch (err) { - failure_stage = "Pull couchdb docker image" - currentBuild.result = 'FAILURE' - throw err - } - } - } - // Pull fabric, fabric-ca Docker Images stage("Pull Docker Images") { wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { diff --git a/scripts/Jenkins_Scripts/CI_Script.sh b/scripts/Jenkins_Scripts/CI_Script.sh index 0ce88cdf24..94eac1ce4a 100755 --- a/scripts/Jenkins_Scripts/CI_Script.sh +++ b/scripts/Jenkins_Scripts/CI_Script.sh @@ -14,7 +14,7 @@ export ORG_NAME="hyperledger/fabric" # error check err_Check() { -echo "ERROR !!!! --------> $1 <---------" +echo "\033[31m $1" "\033[0m" exit 1 } @@ -97,7 +97,7 @@ env_Info() { # This function prints system info #### Build Env INFO - echo "-----------> Build Env INFO" + echo -e "\033[32m -----------> Build Env INFO" "\033[0m" # Output all information about the Jenkins environment uname -a cat /etc/*-release @@ -115,10 +115,10 @@ pull_Docker_Images() { if [ $IMAGES == "javaenv" ]; then if [ $ARCH == "s390x" ]; then # Do not pull javaenv if OS_VER == s390x - echo "-----------> skipping pull of javaenv image on s390x" + echo "\033[32m -----------> skipping pull of javaenv image on s390x" "\033[0m" else # Pull javaenv at same level as node SDK - echo "-----------> pull $ORG_NAME-$IMAGES:${ARCH}-${IMAGE_TAG} image" + echo "\033[32m -----------> pull $ORG_NAME-$IMAGES:${IMAGE_TAG} image" "\033[0m" echo docker pull $NEXUS_URL/$ORG_NAME-$IMAGES:${IMAGE_TAG} > /dev/null 2>&1 if [ $? -ne 0 ]; then @@ -149,7 +149,7 @@ pull_Docker_Images() { # run sdk e2e tests sdk_E2e_Tests() { echo - echo "-----------> Execute NODE SDK Integration Tests" + echo -e "\033[32m Execute NODE SDK Integration Tests" "\033[0m" cd ${WORKSPACE}/gopath/src/github.com/hyperledger/fabric-sdk-node || exit # Install nvm to install multi node versions wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash @@ -162,8 +162,8 @@ sdk_E2e_Tests() { nvm install $NODE_VER || true nvm use --delete-prefix v$NODE_VER --silent - echo "npm version ------> $(npm -v)" - echo "node version ------> $(node -v)" + echo -e "\033[32m npm version ------> $(npm -v)" "\033[0m" + echo -e "\033[32m node version ------> $(node -v)" "\033[0m" npm install || err_Check "ERROR!!! npm install failed" npm config set prefix ~/npm && npm install -g gulp && npm install -g istanbul @@ -171,7 +171,7 @@ sdk_E2e_Tests() { ~/npm/bin/gulp ca || err_Check "ERROR!!! gulp ca failed" rm -rf node_modules && npm install || err_Check "ERROR!!! npm install failed" - echo "------> Run Node SDK Unit, FV, and scenario tests" + echo -e "\033[32m ------> Run Node SDK Unit, FV, and scenario tests" "\033[0m" echo "============" ~/npm/bin/gulp test if [ $? == 0 ]; then @@ -186,14 +186,14 @@ sdk_E2e_Tests() { # Publish npm modules after successful merge on amd64 publish_NpmModules() { echo - echo "-----------> Publish npm modules from amd64" + echo -e "\033[32m -----------> Publish npm modules from amd64" "\033[0m" ./Publish_NPM_Modules.sh } # Publish NODE_SDK API docs after successful merge on amd64 publish_ApiDocs() { echo - echo "-----------> Publish NODE_SDK API docs after successful merge on amd64" + echo -e "\033[32m -----------> Publish NODE_SDK API docs after successful merge on amd64" "\033[0m" ./Publish_API_Docs.sh } Parse_Arguments $@