From d4cbb14ec1412c5abbec1f7d5d1231981ce87c1d Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Sun, 6 Jun 2021 13:37:46 -0500 Subject: Jenkins: lib: get github token from Jenkins credentials --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d658d6ac..79ae48d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -226,13 +226,15 @@ pipeline { workingDir: 'build', includePathPattern: 'vyos*.iso') s3Copy(fromBucket: 's3-us.vyos.io', fromPath: 'rolling/' + getGitBranchName() + '/' + files[0].name, toBucket: 's3-us.vyos.io', toPath: getGitBranchName() + '/vyos-rolling-latest.iso') - + } + withCredentials([string(credentialsId: 'GitHub-API-Token', variable: 'TOKEN')]) { // Trigger site rebuild so the download shows. - sh """ + sh ''' + set +x curl -X POST --header "Accept: application/vnd.github.v3+json" \ --header 'authorization: Bearer $TOKEN' --data '{"ref": "production"}' \ https://api.github.com/repos/vyos/community.vyos.net/actions/workflows/main.yml/dispatches - """ + ''' } } -- cgit v1.2.3