From 992af0a5514336d6595194eeeb9c6384b42112ab Mon Sep 17 00:00:00 2001 From: Pol Feliu <> Date: Mon, 23 Dec 2024 09:04:52 +0100 Subject: [PATCH 1/2] migrate to publish to distext via ssh --- Jenkinsfile | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 210cf792..1767161d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -123,6 +123,8 @@ pipeline { stage('Build wheels') { steps { bat "py -${DEFAULT_PYTHON_VERSION} -m tox -e build" + stash includes: 'dist\\*', name: 'build' + archiveArtifacts artifacts: "dist\\*" } } stage('Make a static type analysis') { @@ -138,6 +140,10 @@ pipeline { stage('Generate documentation') { steps { bat "py -${DEFAULT_PYTHON_VERSION} -m tox -e docs" + bat """ + "C:\\Program Files\\7-Zip\\7z.exe" a -r docs.zip -w _docs -mem=AES256 + """ + stash includes: 'docs.zip', name: 'docs' } } stage("Run unit tests") { @@ -179,33 +185,36 @@ pipeline { } } } - stage('Archive') { - steps { - bat """ - "C:\\Program Files\\7-Zip\\7z.exe" a -r docs.zip -w _docs -mem=AES256 - """ - stash includes: 'dist\\*, docs.zip', name: 'publish_files' - archiveArtifacts artifacts: "dist\\*, docs.zip" - } - } } } - stage('Publish ingeniamotion') { - when { + stage('Publish documentation') { + /* when { beforeAgent true branch BRANCH_NAME_MASTER + } */ + agent { + label "worker" + } + steps { + unstash 'docs' + unzip zipFile: 'docs.zip', dir: '.' + // publishDistExt("_docs", DISTEXT_PROJECT_DIR, false) } + } + stage('Publish to pypi') { + /*when { + beforeAgent true + branch BRANCH_NAME_MASTER + }*/ agent { docker { - label "worker" + label 'worker' image "ingeniacontainers.azurecr.io/publisher:1.8" } } steps { - unstash 'publish_files' - unzip zipFile: 'docs.zip', dir: '.' - publishDistExt("_docs", DISTEXT_PROJECT_DIR, false) - publishPyPi("dist/*") + unstash 'build' + // publishPyPi("dist/*") } } } From 5aad8a0b258e97d7169096ebcddcc0efa8c97d31 Mon Sep 17 00:00:00 2001 From: Pol Feliu <> Date: Mon, 23 Dec 2024 15:46:18 +0100 Subject: [PATCH 2/2] remove commented pipeline for testing --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1767161d..b658d7f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -188,24 +188,24 @@ pipeline { } } stage('Publish documentation') { - /* when { + when { beforeAgent true branch BRANCH_NAME_MASTER - } */ + } agent { label "worker" } steps { unstash 'docs' unzip zipFile: 'docs.zip', dir: '.' - // publishDistExt("_docs", DISTEXT_PROJECT_DIR, false) + publishDistExt("_docs", DISTEXT_PROJECT_DIR, false) } } stage('Publish to pypi') { - /*when { + when { beforeAgent true branch BRANCH_NAME_MASTER - }*/ + } agent { docker { label 'worker' @@ -214,7 +214,7 @@ pipeline { } steps { unstash 'build' - // publishPyPi("dist/*") + publishPyPi("dist/*") } } }