Skip to content

Commit

Permalink
Update Jenkinsfile (#545)
Browse files Browse the repository at this point in the history
ci: Reading Package Metadata stage can run in any node as long as it has docker
  • Loading branch information
henryborchers authored Oct 7, 2024
1 parent 05810a9 commit 5afd772
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,20 @@ startup()

def get_props(){
stage('Reading Package Metadata'){
node('docker && linux') {
node('docker') {
checkout scm
docker.image('python').inside {
def packageMetadata = readJSON text: sh(returnStdout: true, script: 'python -c \'import tomllib;print(tomllib.load(open("pyproject.toml", "rb"))["project"])\'').trim()
def packageMetadata = readJSON(
text: {
if (isUnix()){
return sh(returnStdout: true, script: 'python -c \'import tomllib;print(tomllib.load(open("pyproject.toml", "rb"))["project"])\'').trim()
} else {
return bat(returnStdout: true, script: '@python -c "import tomllib;print(tomllib.load(open(\'pyproject.toml\', \'rb\'))[\'project\'])').trim()
}


}()
)
echo """Metadata:
Name ${packageMetadata.name}
Expand Down

0 comments on commit 5afd772

Please sign in to comment.