Writing a Jenkins Pipeline: Difference between revisions
Jump to navigation
Jump to search
(→Steps) |
|||
Line 8: | Line 8: | ||
=Steps= | =Steps= | ||
These steps are used invoking on <code>stage.</code>. In a Jenkinsfile, and inside a stage, invoke on <code>this.</code> | These steps are used invoking on <code>stage.</code>. In a Jenkinsfile, and inside a stage, invoke on <code>this.</code> or simply invoking directly like below: | ||
* read-file step. Reading a file from the workspace: https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#readfile-read-file-from-workspace | * read-file step. Reading a file from the workspace: https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#readfile-read-file-from-workspace | ||
<syntaxhighlight lang='groovy'> | <syntaxhighlight lang='groovy'> | ||
def versionFile = | def versionFile = readFile("${stage.WORKSPACE}/terraform/my-module/VERSION") | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* error https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#error-error-signal | * error https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#error-error-signal |
Revision as of 06:20, 21 November 2019
Internal
Steps
These steps are used invoking on stage.
. In a Jenkinsfile, and inside a stage, invoke on this.
or simply invoking directly like below:
- read-file step. Reading a file from the workspace: https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#readfile-read-file-from-workspace
def versionFile = readFile("${stage.WORKSPACE}/terraform/my-module/VERSION")