33def doPythonWheels () {
44 version = sh(script : ' git describe --tags \$ (git rev-list --tags --max-count=1) || true' , returnStdout : true ). trim()
55 checkTag = sh(script : ' git describe --tags --exact-match ${GIT_COMMIT}' , returnStatus : true )
6- repo = " master"
7- if (! checkTag) {
6+ if (checkTag != 0 ) {
87 version + = " .dev" + env. BUILD_NUMBER
9- repo = " develop"
108 }
119
1210 sh(script : " sed -i.bak 's/{{ PYPI_VERSION }}/${ version} /g' setup.py;" )
@@ -18,17 +16,25 @@ def doPythonWheels() {
1816}
1917
2018def publishWheels () {
21- checkTag = sh(script : ' git describe --tags --exact-match ${GIT_COMMIT}' , returnStatus : true )
22- withCredentials([usernamePassword(credentialsId : ' ci_nexus' , passwordVariable : ' CI_NEXUS_PASSWORD' , usernameVariable : ' CI_NEXUS_USERNAME' )]) {
23- sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec curl -u ${ CI_NEXUS_USERNAME} :${ CI_NEXUS_PASSWORD} --upload-file {} https://nexus.iroha.tech/repository/artifacts/iroha-python/${ repo} /{} \\ ;" )
24- sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec echo 'https://nexus.iroha.tech/service/rest/repository/browse/artifacts/iroha-python/${ repo} /{} \\ ;" )
19+ repo = " release"
20+ checkTag = sh(script : ' git describe --tags --exact-match ${GIT_COMMIT}' , returnStatus : true )
21+ version = sh(script : ' git describe --tags \$ (git rev-list --tags --max-count=1) || true' , returnStdout : true ). trim()
22+ if (checkTag != 0 ) {
23+ version + = " .dev" + env. BUILD_NUMBER
24+ repo = " develop"
2525 }
26- if (checkTag) {
27- iC = docker. image(' quay.io/pypa/manylinux1_x86_64' )
28- iC. inside(" " ) {
29- sh(script : ' /opt/python/cp35-cp35m/bin/pip install twine' , returnStdout : true )
30- sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec echo 'https://nexus.iroha.tech/service/rest/repository/browse/artifacts/iroha-python/latest.whl \\ ;" )
31- sh " /opt/python/cp35-cp35m/bin/twine upload --skip-existing -u ${ ci_pypi_username} -p ${ ci_pypi_password} --repository-url https://test.pypi.org/legacy/ wheelhouse/iroha*.whl"
26+ withCredentials([usernamePassword(credentialsId : ' ci_nexus' , passwordVariable : ' CI_NEXUS_PASSWORD' , usernameVariable : ' CI_NEXUS_USERNAME' ), usernamePassword(credentialsId : ' ci_iroha_pypi' , passwordVariable : ' CI_PYPI_PASSWORD' , usernameVariable : ' CI_PYPI_USERNAME' )]) {
27+ sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec curl -u ${ CI_NEXUS_USERNAME} :${ CI_NEXUS_PASSWORD} --upload-file {} https://nexus.iroha.tech/repository/artifacts/iroha-python/${ repo} /{} \\ ;" )
28+ sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec echo 'Wheel available at https://nexus.iroha.tech/service/rest/repository/browse/artifacts/iroha-python/${ repo} /{}' \\ ;" )
29+
30+ if (checkTag == 0 ) {
31+ iC = docker. image(' quay.io/pypa/manylinux1_x86_64' )
32+ iC. inside(" " ) {
33+ sh(script : ' /opt/python/cp35-cp35m/bin/pip install twine' , returnStdout : true )
34+ sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec curl -u ${ CI_NEXUS_USERNAME} :${ CI_NEXUS_PASSWORD} --upload-file {} https://nexus.iroha.tech/repository/artifacts/iroha-python/latest.whl \\ ;" )
35+ sh(script : " cd wheelhouse && find . -type f -name \" iroha*.whl\" -exec echo 'Latest release available at https://nexus.iroha.tech/service/rest/repository/browse/artifacts/iroha-python/latest.whl' \\ ;" )
36+ sh " /opt/python/cp35-cp35m/bin/twine upload --skip-existing -u ${ CI_PYPI_USERNAME} -p ${ CI_PYPI_PASSWORD} wheelhouse/iroha*.whl"
37+ }
3238 }
3339 }
3440}
0 commit comments