From 56a29dc11c6c487a13d0a27248b3c7beabe1f43e Mon Sep 17 00:00:00 2001 From: HERVE Thomas Date: Fri, 25 Feb 2022 13:35:39 +0100 Subject: [PATCH 1/5] Init --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4516d92dbc..87b05351d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,11 @@ pipeline { agent { - label infra.getAgentLabels() + docker { + label 'docker-dev-1' + image infra.getDockerAgentImage() + args '--entrypoint=/startup.sh --oom-score-adj=100 -v /opt/cov:/opt/cov:ro -v /etc/ssh/id_rsa_git-proxy-cache:/etc/ssh/id_rsa_git-proxy-cache:ro -v /etc/ssh/ssh_config:/etc/ssh/ssh_config:ro -v /etc/gitconfig:/etc/gitconfig:ro' + } } parameters { // Use DEFAULT_DEPLOY_BRANCH_PATTERN and DEFAULT_DEPLOY_JOB_NAME if From fa58cef4e92e89c4ca44025a41913aa549916934 Mon Sep 17 00:00:00 2001 From: HERVE Thomas Date: Fri, 25 Feb 2022 13:45:28 +0100 Subject: [PATCH 2/5] Use jenkins lib to push to MBT --- Jenkinsfile | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 87b05351d5..755ed01ade 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -618,40 +618,10 @@ OUT="`git status -s`" && [ -z "\$OUT" ] \\ } } // Commit Coverity - stage ('deploy if appropriate') { + stage ('deploy') { steps { script { - def myDEPLOY_JOB_NAME = sh(returnStdout: true, script: """echo "${params["DEPLOY_JOB_NAME"]}" """).trim(); - def myDEPLOY_BRANCH_PATTERN = sh(returnStdout: true, script: """echo "${params["DEPLOY_BRANCH_PATTERN"]}" """).trim(); - def myDEPLOY_REPORT_RESULT = sh(returnStdout: true, script: """echo "${params["DEPLOY_REPORT_RESULT"]}" """).trim().toBoolean(); - echo "Original: DEPLOY_JOB_NAME : ${params["DEPLOY_JOB_NAME"]} DEPLOY_BRANCH_PATTERN : ${params["DEPLOY_BRANCH_PATTERN"]} DEPLOY_REPORT_RESULT : ${params["DEPLOY_REPORT_RESULT"]}" - echo "Used: myDEPLOY_JOB_NAME:${myDEPLOY_JOB_NAME} myDEPLOY_BRANCH_PATTERN:${myDEPLOY_BRANCH_PATTERN} myDEPLOY_REPORT_RESULT:${myDEPLOY_REPORT_RESULT}" - if ( (myDEPLOY_JOB_NAME != "") && (myDEPLOY_BRANCH_PATTERN != "") ) { - if ( env.BRANCH_NAME =~ myDEPLOY_BRANCH_PATTERN ) { - def GIT_URL = sh(returnStdout: true, script: """git remote -v | egrep '^origin' | awk '{print \$2}' | head -1""").trim() - def GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse --verify HEAD').trim() - def DIST_ARCHIVE = "" - def msg = "Would deploy ${GIT_URL} ${GIT_COMMIT} because tested branch '${env.BRANCH_NAME}' matches filter '${myDEPLOY_BRANCH_PATTERN}'" - if ( params.DO_DIST_DOCS ) { - DIST_ARCHIVE = env.BUILD_URL + "artifact/__dist.tar.gz" - msg += ", using dist archive '${DIST_ARCHIVE}' to speed up deployment" - } - echo msg - //milestone ordinal: 100, label: "${env.JOB_NAME}@${env.BRANCH_NAME}" - build job: "${myDEPLOY_JOB_NAME}", parameters: [ - string(name: 'DEPLOY_GIT_URL', value: "${GIT_URL}"), - string(name: 'DEPLOY_GIT_BRANCH', value: env.BRANCH_NAME), - string(name: 'DEPLOY_GIT_COMMIT', value: "${GIT_COMMIT}"), - string(name: 'DEPLOY_DIST_ARCHIVE', value: "${DIST_ARCHIVE}") - ], quietPeriod: 0, wait: myDEPLOY_REPORT_RESULT, propagate: myDEPLOY_REPORT_RESULT - } else { - echo "Not deploying because branch '${env.BRANCH_NAME}' did not match filter '${myDEPLOY_BRANCH_PATTERN}'" - } - } else { - echo "Not deploying because deploy-job parameters are not set" - } - - manager.addShortText("Processing of push to packaging completed") + deploy.pushToOBS() } } } From c7776ed8901b25302c3700559dbbaf81acef9dcb Mon Sep 17 00:00:00 2001 From: HERVE Thomas Date: Fri, 25 Feb 2022 14:01:41 +0100 Subject: [PATCH 3/5] Short message jenkins --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 755ed01ade..032ab7d2d6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -622,6 +622,7 @@ OUT="`git status -s`" && [ -z "\$OUT" ] \\ steps { script { deploy.pushToOBS() + manager.addShortText("Pushed to OBS") } } } From b1d5456ff2adecdedda35b199d12e937441c2a02 Mon Sep 17 00:00:00 2001 From: HERVE Thomas Date: Fri, 25 Feb 2022 14:06:26 +0100 Subject: [PATCH 4/5] Re-establish default checkout --- Jenkinsfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 032ab7d2d6..9e4904bb1d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,6 @@ pipeline { // record that a particular commit is being processed, but the explicit ways // might work better. In either case it honors SCM settings like refrepo if // set up in the Pipeline or MultiBranchPipeline job. - skipDefaultCheckout() } // Note: your Jenkins setup may benefit from similar setup on side of agents: // PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/bin:/bin:${PATH}" @@ -124,15 +123,6 @@ pipeline { } } - stage ('git') { - steps { - retry(3) { - checkout scm - } - milestone ordinal: 30, label: "${env.JOB_NAME}@${env.BRANCH_NAME}" - } - } - stage ('prepare') { steps { sh './autogen.sh' From 1de19cb6555655fce957eef0741b253c1d41b9cd Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Fri, 25 Feb 2022 17:19:17 +0100 Subject: [PATCH 5/5] Update debian.rules Fix debian.rules --- obs/debian.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs/debian.rules b/obs/debian.rules index 9d988f3d41..0567297e2f 100755 --- a/obs/debian.rules +++ b/obs/debian.rules @@ -81,7 +81,7 @@ endif DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto configure: configure.ac - (cd tools; python nut-snmpinfo.py) + #(cd tools; python nut-snmpinfo.py) sh autogen.sh pre-build:: debian/compat configure