From bed5a10c06f830d5482151f9e9424c239e650e2d Mon Sep 17 00:00:00 2001 From: jakubgs Date: Tue, 29 Jun 2021 16:06:03 +0000 Subject: [PATCH] deploy: f140a71d6d5e93e73a737a756d2682ee70011cd9 --- Makefile | 5 +- ci/Jenkinsfile.prs | 99 +++++++++++++++++++ Jenkinsfile => ci/Jenkinsfile.release | 0 .../vendor/libbacktrace-upstream/libtool | 2 +- 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 ci/Jenkinsfile.prs rename Jenkinsfile => ci/Jenkinsfile.release (100%) diff --git a/Makefile b/Makefile index c183772f6..4f745b11c 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,10 @@ GIT_SUBMODULE_UPDATE := git submodule update --init --recursive else # "variables.mk" was included. Business as usual until the end of this file. # default target, because it's the first one that doesn't start with '.' -all: | wakunode1 sim1 example1 wakunode2 sim2 example2 chat2 bridge chat2bridge +all: | v1 v2 + +v1: | wakunode1 sim1 example1 +v2: | wakunode2 sim2 example2 chat2 bridge chat2bridge # must be included after the default target -include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk diff --git a/ci/Jenkinsfile.prs b/ci/Jenkinsfile.prs new file mode 100644 index 000000000..59b92e679 --- /dev/null +++ b/ci/Jenkinsfile.prs @@ -0,0 +1,99 @@ +library 'status-jenkins-lib@v1.2.18' + +pipeline { + agent { label getAgentLabel() } + + parameters { + string( + name: 'NIM_PARAMS', + description: 'Flags for Nim compilation.', + defaultValue: params.NIM_PARAMS ?: '-d:disableMarchNative -d:insecure --parallelBuild:6' + ) + string( + name: 'LOG_LEVEL', + description: 'Build logging level. (DEBUG, TRACE)', + defaultValue: params.LOG_LEVEL ?: 'DEBUG' + ) + string( + name: 'VERBOSITY', + description: 'Makefile verbosity level.(0-2)', + defaultValue: params.VERBOSITY ?: '0' + ) + string( + name: 'MAKEFLAGS', + description: 'Makefile flags.', + defaultValue: params.MAKEFLAGS ?: '-j6' + ) + } + + options { + timestamps() + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '3', + daysToKeepStr: '30', + artifactNumToKeepStr: '1', + )) + } + + environment { + TARGET = getAgentLabel() + } + + stages { + stage('Deps') { steps { + cache(maxCacheSize: 250, caches: [[ + $class: 'ArbitraryFileCache', excludes: '', includes: '**/*', + path: 'vendor/nimbus-build-system/vendor/Nim/bin', + ]]) { + sh "make V=${params.VERBOSITY} update" + } + sh "make V=${params.VERBOSITY} deps" + } } + + stage('Binaries') { + parallel { + stage('V1') { steps { sh "make V=${params.VERBOSITY} v1" } } + stage('V2') { steps { sh "make V=${params.VERBOSITY} v2" } } + } + } + + stage('Run Tests') { + parallel { + stage('V1') { steps { sh "make V=${params.VERBOSITY} test1" } } + stage('V2') { steps { sh "make V=${params.VERBOSITY} test2" } } + } + } + + stage('Upload') { steps { script { + def out = genOutputFilename() + sh "mv build/wakunode2 ${out}" + env.PKG_URL = s3.uploadArtifact(out) + jenkins.setBuildDesc(Waku: env.PKG_URL) + } } } + } // stages + post { + success { script { github.notifyPR(true) } } + failure { script { github.notifyPR(false) } } + } // post +} // pipeline + + +/* This allows us to use one Jenkinsfile and run + * jobs on different platforms based on job name. */ +def getAgentLabel() { + if (params.AGENT_LABEL) { + return params.AGENT_LABEL + } + def tokens = env.JOB_NAME.split('/') + for (platform in ['linux', 'macos', 'windows']) { + if (tokens.contains(platform)) { return platform } + } + throw new Exception('No agent provided or found in job path!') +} + +def genOutputFilename() { + return [ + "wakunode2", utils.timestamp(), utils.gitCommit(), getAgentLabel() + ].join('-') + (env.NODE_NAME.startsWith('windows') ? '.exe' : '.bin') +} diff --git a/Jenkinsfile b/ci/Jenkinsfile.release similarity index 100% rename from Jenkinsfile rename to ci/Jenkinsfile.release diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index 518f13c00..7d4bdaf85 100755 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool @@ -2,7 +2,7 @@ # libtool - Provide generalized library-building support services. # Generated automatically by config.status (libbacktrace) version-unused -# Libtool was configured on host fv-az199-877: +# Libtool was configured on host fv-az269-761: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,