From b867f333a1d360f6aaf6487b655b6794b9d0bb83 Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 8 Apr 2023 05:36:11 -0500 Subject: [PATCH 1/6] Changed to using mamba environment --- Jenkinsfile | 24 ++++++++++++++++++++++++ environment.yaml | 10 ++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Jenkinsfile create mode 100644 environment.yaml diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..73afdcd --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,24 @@ +pipeline { + agent any + stages { + stage("install") { + steps { + sh 'conda env update --file environment.yml' + sh 'echo "conda activate renamebycsv" >> ~/.bashrc' + } + } + stage("build") { + steps { + sh "python -m build" + } + } + stage("publish") { + steps { + withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) { + // some block + sh "pip -m twine upload --repository-url https://git.reslate.systems -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" + } + } + } + } +} \ No newline at end of file diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 0000000..970072c --- /dev/null +++ b/environment.yaml @@ -0,0 +1,10 @@ +name: renamebycsv +channels: + - anaconda + - conda-forge +dependencies: + - build=0.7.0 + - pytest=7.2.2 + - python=3.11.3 + - setuptools=67.6.1 + - twine=4.0.2 From 1fea13d053563b348e3d83e3cf623032e94f19a5 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 6 Apr 2023 09:51:29 -0500 Subject: [PATCH 2/6] Change image to debian --- .woodpecker.yml | 18 ------------------ environment.yaml => environment.yml | 0 2 files changed, 18 deletions(-) delete mode 100644 .woodpecker.yml rename environment.yaml => environment.yml (100%) diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 49b377c..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,18 +0,0 @@ -# .woodpecker.yml -pipeline: - install: - image: python - commands: - - pip install build - - pip install pytest - - pip install setuptools - - pip install twine - build: - image: python - commands: - - python -m build - publish: - image: python - commands: - - pip -m twine upload --repository-url https://git.reslate.systems -u ${CI_NETRC_USERNAME} -p ${CI_NETRC_PASSWORD} --non-interactive --disable-progress-bar --verbose dist/* - \ No newline at end of file diff --git a/environment.yaml b/environment.yml similarity index 100% rename from environment.yaml rename to environment.yml From edec2cb929f932c5e9c392c53b0f7a797aae0724 Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 8 Apr 2023 05:45:31 -0500 Subject: [PATCH 3/6] Fixed Jenkinsfile --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 73afdcd..f0d2fb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,9 +15,8 @@ pipeline { stage("publish") { steps { withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) { - // some block - sh "pip -m twine upload --repository-url https://git.reslate.systems -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" - } + sh "python -m twine upload --repository-url https://git.reslate.systems -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" + } } } } From cc6c9bd0db824255dff7507f8f50c514a0924cf6 Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 8 Apr 2023 05:55:09 -0500 Subject: [PATCH 4/6] Downgraded environment cryptography package --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 970072c..6b3b687 100644 --- a/environment.yml +++ b/environment.yml @@ -8,3 +8,4 @@ dependencies: - python=3.11.3 - setuptools=67.6.1 - twine=4.0.2 + - cryptography=38.0.4 From 739ac17b021074a52e80731cad01b21e9f184a0a Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 8 Apr 2023 12:51:38 -0500 Subject: [PATCH 5/6] Fixed pipeline publishing stage --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f0d2fb5..e3f3fdf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stage("publish") { steps { withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) { - sh "python -m twine upload --repository-url https://git.reslate.systems -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" + sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*" } } } From 9ed70b317d1de794d20a2eac92cb98c4ad4e5c07 Mon Sep 17 00:00:00 2001 From: Harrison Date: Sat, 8 Apr 2023 13:14:45 -0500 Subject: [PATCH 6/6] Jenkins pipeline now only publishes when on main branch --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e3f3fdf..0a001d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,9 @@ pipeline { } } stage("publish") { + when { + branch '**/master' + } steps { withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) { sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*"