Skip to content

Instantly share code, notes, and snippets.

View Synida's full-sized avatar
🐢

Synida

🐢
  • Somewhere, over the rainbow
View GitHub Profile
@gabor-farkas
gabor-farkas / Jenkinsfile
Created February 5, 2019 08:54
Setting Github commit status in a declarative Jenkins pipeline with curl in sh
void setBuildStatus(String message, String context, String state) {
// add a Github access token as a global 'secret text' credential on Jenkins with the id 'github-commit-status-token'
withCredentials([string(credentialsId: 'github-commit-status-token', variable: 'TOKEN')]) {
// 'set -x' for debugging. Don't worry the access token won't be actually logged
// Also, the sh command actually executed is not properly logged, it will be further escaped when written to the log
sh """
set -x
curl \"https://api.github.com/repos/org/repo/statuses/$GIT_COMMIT?access_token=$TOKEN\" \
-H \"Content-Type: application/json\" \
-X POST \
@staltz
staltz / introrx.md
Last active June 12, 2024 14:28
The introduction to Reactive Programming you've been missing