This file contains hidden or 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
version: v1.0 | |
name: Commands in Semaphore | |
agent: | |
machine: | |
type: e1-standard-2 | |
os_image: ubuntu2004 | |
queue: | |
processing: parallel |
This file contains hidden or 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
// I wrote a Jenkinsfile shared library method to check job parameters for mandatory fields. The | |
// list of mandatory fields depended on other parameter values. Writing this as a reference because | |
// it wasn't immediately obvious how to use a (groovy) variable to access an env variable. | |
properties([ | |
parameters([ | |
string(name: 'MY_PARAM', defaultValue: '1.0.0', description: 'Useful description here.'), | |
]) | |
]) |
This file contains hidden or 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
node{ | |
timestamps{ | |
stage('Samples'){ | |
// Single quotes with no interpolation, at least not in Jenkins. | |
// The dollar variable will be evaluated before being run by the | |
// shell command, so variables which Jenkins makes available as | |
// environment variables can still be accessed from within a | |
// single-quoted string, passed to the sh task. | |
sh 'echo $PATH' |