Skip to content

Commit

Permalink
feat: update OSCAR services
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Aug 9, 2024
1 parent dfe44bb commit 3db8a90
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,43 @@ pipeline {
}
}
}
stage('Update OSCAR services') {
when {
expression {env.MODULES.contains(env.THIS_REPO)}
}
environment {
MYTOKEN = credentials('mytoken-token')
}

steps {
script {
// Download OSCAR CLI from https
sh "curl -L -o oscar-cli https://github.com/grycap/oscar-cli/releases/download/v1.7.1/oscar-cli"
sh "chmod +x oscar-cli"

access_token = sh (returnStdout: true, script: "mytoken AT --MT-env MYTOKEN").trim()

metadata = readJSON file: "metadata.json"

// Create metadata file
oscar_meta = [
"token": access_token,
"metadata": metadata
]

// FIXME(aloga): this should be present in the metadata file, and therefore we should not hardcode it here
oscar_meta["metadata"]["resources"] = [
"cpu": "0.5",
"memory": "500MB"
]

writeFile file: "oscar-metadata.json", text: oscar_meta as String

// Update OSCAR services
sh "./oscar-cli service run update-modules-service --input oscar-metadata.json"
}
}
}
stage('Cleanup') {
steps {
script {
Expand Down

0 comments on commit 3db8a90

Please sign in to comment.