Changeset View
Changeset View
Standalone View
Standalone View
jobs/templates/swh-pipeline.groovy
pipeline {{ | pipeline {{ | ||||
agent {{ label '{docker-image}' }} | agent {{ label '{docker-image}' }} | ||||
environment {{ | environment {{ | ||||
PHAB_CONDUIT_URL = 'https://forge.softwareheritage.org/api/' | PHAB_CONDUIT_URL = 'https://forge.softwareheritage.org/api/' | ||||
}} | }} | ||||
stages {{ | stages {{ | ||||
stage('Checkout') {{ | stage('Checkout') {{ | ||||
steps {{ | steps {{ | ||||
withCredentials([ | withCredentials([ | ||||
string(credentialsId: 'swh-public-ci', | string(credentialsId: 'swh-public-ci', | ||||
variable: 'PHAB_CONDUIT_TOKEN')]) {{ | variable: 'PHAB_CONDUIT_TOKEN')]) {{ | ||||
sh ''' | sh ''' | ||||
if [ -n "$PHID" ]; then | if [ -n "$PHID" ]; then | ||||
echo "{ | |||||
\\\"buildTargetPHID\\\": \\\"$PHID\\\", | |||||
\\\"artifactKey\\\": \\\"link.jenkins\\\", | |||||
\\\"artifactType\\\": \\\"uri\\\", | |||||
\\\"artifactData\\\": { | |||||
\\\"uri\\\": \\\"$BUILD_URL\\\", | |||||
\\\"name\\\": \\\"Jenkins\\\", | |||||
\\\"ui.external\\\": true | |||||
} | |||||
}" | arc call-conduit --conduit-uri $PHAB_CONDUIT_URL --conduit-token $PHAB_CONDUIT_TOKEN harbormaster.createartifact | |||||
python3 -m pyarcanist send-message work $PHID | python3 -m pyarcanist send-message work $PHID | ||||
fi | fi | ||||
''' | ''' | ||||
}} | }} | ||||
checkout([$class: 'GitSCM', | checkout([$class: 'GitSCM', | ||||
branches: [[name: "${{params.REVISION}}"]], | branches: [[name: "${{params.REVISION}}"]], | ||||
doGenerateSubmoduleConfigurations: false, | doGenerateSubmoduleConfigurations: false, | ||||
extensions: [], | extensions: [], | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | always {{ | ||||
python3 -m pyarcanist send-message $MSGTYPE $PHID | python3 -m pyarcanist send-message $MSGTYPE $PHID | ||||
fi | fi | ||||
''' | ''' | ||||
}} // withEnv | }} // withEnv | ||||
}} // withCredentials | }} // withCredentials | ||||
}} // always | }} // always | ||||
}} // post | }} // post | ||||
}} // pipeline | }} // pipeline | ||||
No newline at end of file | No newline at end of file |