Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pipeline example for loading groovy code directly from github #26

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipeline-examples/load-from-file/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Synopsis

A very simple example demonstrating how the load method allows you to
read in Groovy files and then call the code in them.
read in Groovy files from disk or from the web and then call the code in them.
8 changes: 8 additions & 0 deletions pipeline-examples/load-from-file/loadFromGithub.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!groovy
/*
Instead of duplicating a lot of build related code in each repo include the common one from this file using the command below:

Don't forget to put configure GITHUB_TOKEN inside Jenkins as it is a very bad idea to include it inside your code.
*/

apply from: 'https://raw.githubusercontent.com/org-name/repo-name/master/subfolder/Jenkinsfile?token=${env.GITHUB_TOKEN}'