summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Hagen <kim@sentrium.io>2021-06-06 13:37:46 -0500
committerKim Hagen <kim@sentrium.io>2021-06-06 13:37:46 -0500
commitd4cbb14ec1412c5abbec1f7d5d1231981ce87c1d (patch)
treeab51764e9b11477a84d7d2e65c1571726a847886
parent1979215a1525da78277b89867ddc9ed3a282b65d (diff)
downloadvyos-build-d4cbb14ec1412c5abbec1f7d5d1231981ce87c1d.tar.gz
vyos-build-d4cbb14ec1412c5abbec1f7d5d1231981ce87c1d.zip
Jenkins: lib: get github token from Jenkins credentials
-rw-r--r--Jenkinsfile8
1 files 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
- """
+ '''
}
}