Skip to content

Commit

Permalink
Add Jenkins job for bumping version on website
Browse files Browse the repository at this point in the history
References #471
  • Loading branch information
Daniel15 committed Apr 29, 2017
1 parent 3bd3f17 commit a5b9cac
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions jenkins_jobs.groovy
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
// Jenkins build jobs for Yarn
// https://build.dan.cx/view/Yarn/

/**
* Trigger that fires when a new stable Yarn version is released
* This could probably be smarter in the future (eg. handle it using a webhook
* rather than polling the version number)
*/
def yarnStableVersionChange = {
triggerContext -> triggerContext.with {
urlTrigger {
cron 'H/15 * * * *'
url('https://yarnpkg.com/latest-version') {
inspection 'change'
job('yarn-version') {
description 'Updates the version number on the Yarn website'
label 'linux'
authenticationToken "${YARN_VERSION_KEY}"
scm {
git {
branch 'master'
remote {
github 'yarnpkg/website', 'ssh'
}
extensions {
// Required so we can commit to master
// http://stackoverflow.com/a/29786580/210370
localBranch 'master'
}
}
}
parameters {
stringParam 'YARN_VERSION'
booleanParam 'YARN_RC'
}
steps {
shell '''
./scripts/set-version.sh
git commit -m "Automated upgrade to Yarn $YARN_VERSION" _config.yml
'''
}
publishers {
git {
branch 'origin', 'master'
pushOnlyIfSuccess
}
gitHubIssueNotifier {
}
}
}

matrixJob('yarn-e2e') {
Expand Down Expand Up @@ -51,7 +72,7 @@ job('yarn-chocolatey') {
github 'yarnpkg/yarn', 'master'
}
triggers {
yarnStableVersionChange delegate
upstream 'yarn-version'
}
steps {
powerShell '.\\scripts\\build-chocolatey.ps1 -Publish'
Expand All @@ -70,7 +91,7 @@ job('yarn-homebrew') {
github 'yarnpkg/yarn', 'master'
}
triggers {
yarnStableVersionChange delegate
upstream 'yarn-version'
}
steps {
shell './scripts/update-homebrew.sh'
Expand Down

0 comments on commit a5b9cac

Please sign in to comment.