-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
35 lines (34 loc) · 1.1 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def slackMessages = []
pipeline {
agent { label "guixsd" }
triggers {
cron("H 15 * * *")
}
environment {
GITHUB_TOKEN_STARRED = credentials('GITHUB_TOKEN_STARRED')
}
stages {
stage("Update README.md") {
steps {
dir(library('jenkins-wi-shared-library').Constants.homeDir + "/src/awesome") {
script {
sh "starred --token=$GITHUB_TOKEN_STARRED --username wigust --sort > README.md"
catchError(buildResult: "SUCCESS", stageResult: "FAILURE") {
sh 'git commit -m "Update" README.md'
}
sh 'sshpass -Ppassphrase -p"$(pass show github/ssh/id_rsa_github)" git push github'
slackMessages += "wigust/awesome pushed to github.com"
}
}
}
}
}
post {
always {
sendSlackNotifications (
buildStatus: currentBuild.result,
threadMessages: slackMessages
)
}
}
}