Changeset View
Changeset View
Standalone View
Standalone View
jobs/templates/swh-pypi.groovy.j2
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | stage('Checkout') { | ||||
userRemoteConfigs: [[url: 'https://forge.softwareheritage.org/source/{{repo_name}}.git']] | userRemoteConfigs: [[url: 'https://forge.softwareheritage.org/source/{{repo_name}}.git']] | ||||
]) | ]) | ||||
sh '''rm -rf dist/''' | sh '''rm -rf dist/''' | ||||
} | } | ||||
} | } | ||||
stage('Build') { | stage('Build') { | ||||
steps { | steps { | ||||
withCredentials([ | |||||
string(credentialsId: 'sentry-auth-token', | |||||
variable: 'SENTRY_AUTH_TOKEN')]) { | |||||
sh """ | sh """ | ||||
# Build javascript assets | # Build javascript assets | ||||
if [ -f yarn.lock ]; then | if [ -f yarn.lock ]; then | ||||
yarn install --frozen-lockfile | yarn install --frozen-lockfile | ||||
yarn build | yarn build | ||||
fi | fi | ||||
# Build java assets | # Build java assets | ||||
if [ -d java ]; then | if [ -d java ]; then | ||||
for pom in \$( find java/ -name pom.xml ) ; do | for pom in \$( find java/ -name pom.xml ) ; do | ||||
mvn -f \$pom compile assembly:single | mvn -f \$pom compile assembly:single | ||||
done | done | ||||
fi | fi | ||||
python3 setup.py sdist ${BDIST_WHEEL} | python3 setup.py sdist ${BDIST_WHEEL} | ||||
""" | """ | ||||
archiveArtifacts allowEmptyArchive: true, | archiveArtifacts allowEmptyArchive: true, | ||||
artifacts: 'dist/*', | artifacts: 'dist/*', | ||||
fingerprint: true | fingerprint: true | ||||
} | } | ||||
} | } | ||||
} | |||||
stage('Publish') { | stage('Publish') { | ||||
when { | when { | ||||
anyOf { | anyOf { | ||||
expression { return params.FORCE_UPLOAD } | expression { return params.FORCE_UPLOAD } | ||||
expression { | expression { | ||||
LASTV=sh(returnStdout: true, | LASTV=sh(returnStdout: true, | ||||
script:"curl -s https://${params.PYPI_HOST}/pypi/${module_name}/json | jq -r .info.version || true").trim() | script:"curl -s https://${params.PYPI_HOST}/pypi/${module_name}/json | jq -r .info.version || true").trim() | ||||
Show All 20 Lines |