diff --git a/.jenkins/scripts/generate_wheels.sh b/.jenkins/scripts/generate_wheels.sh deleted file mode 100755 index 695c4e42f..000000000 --- a/.jenkins/scripts/generate_wheels.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -#--------------------------------------# -# Clinica package creations ( wheels) -#--------------------------------------# -# -# WARNING: Activate a conda environment with the right pip version. -# Use at your own risk. - - -CURRENT_DIR=$(pwd) -echo "$CURRENT_DIR" - -# ensure we are in the right dir -SCRIPT_DIR=$(dirname "$0") -cd "$SCRIPT_DIR" -echo "Entering ${SCRIPT_DIR}/../../" -cd "${SCRIPT_DIR}/../../" -ls - -# clean pycache stuff -rm -rf dist build clinica.egg-info/ -find . -name "*__pycache__*" -exec rm {} -rf \; -find . -name "*.pyc*" -exec rm {} -rf \; - -set -o errexit -set -e -# generate wheel -poetry build -# come back to directory of -cd "$CURRENT_DIR" diff --git a/Jenkinsfile b/Jenkinsfile index d5b4b129f..e4a3dd2ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -330,25 +330,20 @@ pipeline { CONDA_HOME = "$HOME/miniconda" } steps { - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda create -p "${WORKSPACE}/env" python=3.8 poetry twine - conda activate "${WORKSPACE}/env" - cd "${WORKSPACE}/.jenkins/scripts" - ./generate_wheels.sh - ''' withCredentials( [ usernamePassword( - credentialsId: 'jenkins-pass-for-pypi-aramis', + credentialsId: 'jenkins-token-for-pypi-clinica', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD' ) ] ) { sh ''' - cd "${WORKSPACE}" - twine upload -u "${USERNAME}" -p "${PASSWORD}" ./dist/* + source "${CONDA_HOME}/etc/profile.d/conda.sh" + conda create -p "${WORKSPACE}/env" python=3.8 poetry + conda activate "${WORKSPACE}/env" + poetry publish --build -u "${USERNAME}" -p "${PASSWORD}" ''' } }