Pipeline load and load from git
2018-04-05 23:44
567 查看
load
https://www.sourcefield.nl/post/jenkins-pipeline-tutorial/
node { // Use the shell to create the file 'script.groovy' sh '''echo ' def hello(name) { echo "Hello ${name} from script" } return this ' > script.groovy''' def script = load 'script.groovy' script.hello('Roy') }
load from git
Loading a script from another Git repository
This requires the Pipeline Remote File Loader plugin. The example assumes you have a repository somewhere that contains a
Pipeline.groovyfile, which you want to download to your Jenkins workspace.
-
Go to Manage Jenkins > Manage Plugins and install
Pipeline Remote File Loader
(without restart) -
Configure a Pipeline job and set the Pipeline script to the following:
node { stage 'Load pipeline script' def pipeline = fileLoader.fromGit( 'Pipeline.groovy', 'https://bitbucket.org/your-account/your-build-scripts.git', 'master', // use a branch or tag 'your-account-credential-id', // ID from Credentials plugin '' ) checkout scm pipeline.execute() }
相关文章推荐
- Git CMD - rm: Remove files from the working tree and from the index
- Hudson (Jenkins) and Git HTTP authentication | Views From The Hill
- 【转】Save and Load from XML
- A functional example for save and load model from Tensorflow
- Spring Cloud (14) | 微服务不能从git/github/gitlab中获取数据库信息 can't load properties from git/github/gitlab
- Compiling and running pulseaudio from git
- [Nuxt] Load Data from APIs with Nuxt and Vuex
- How to use virtual path providers to dynamically load and compile content from virtual paths in
- Load and Unload - quoted from lostall
- Git CMD - fetch: Download objects and refs from another repository
- Could not load extension from . The 'manifest_version' key must be present and set to 2 (without quo
- git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.
- Tiburon’s LoadFromFile and SaveToFile for Unicode characters
- Save and Load from XML
- How to use virtual path providers to dynamically load and compile content from virtual paths in
- ComboBox on load demand and Getting SelectedValue from second comboBox
- There was a failure executing the receive pipeline document specification from assembly failed to load
- How to load 3d model from different domain and display it with Three.js
- load data from (txt/ table and so on)
- Save and Load from XML