Created
May 14, 2018 17:13
-
-
Save JeffreyMFarley/d9b79dbe18f6dfbb199713bacdd12edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new BaseJobBuilder( | |
name: "pr-builder", | |
description: 'Run unit tests when a pull request is submitted', | |
).build(this).with { | |
GhUtils.ghPrWatcher(delegate, | |
[ | |
ghProject: 'foo/bar', | |
ghHostname: 'github.com', | |
ghAuthId: '<#########>', | |
ghPermitAll: true, | |
ghPrHooks: false, | |
ghPrCron: '*/1 * * * *', | |
ghPrOrgsList: 'foo', | |
ghPrStatusContext: 'Run UI unit tests', | |
ghPrResultMessage: [ | |
'SUCCESS': 'All tests passed', | |
'ERROR': 'There was a problem running the tests', | |
'FAILURE': 'At least one test failed', | |
] | |
] | |
) | |
wrappers { | |
nodejs('Node 8x Current') | |
} | |
steps { | |
shell(""" | |
#!/bin/bash | |
# Remove the current packages in case they changed | |
if [[ -n \$(git diff HEAD origin/dev -- package-lock.json) ]]; then | |
rm -rf node_modules | |
npm install | |
fi | |
grunt build | |
npm test | |
""".stripIndent()) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment