Add checkout method

This commit is contained in:
Jim Nicholson 2024-02-01 03:41:46 -08:00
parent fc0865e82c
commit ca4abd5284
2 changed files with 26 additions and 0 deletions

16
vars/checkoutStep.groovy Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env groovy
String call(Map config = [:]) {
Map defaults = [
dirtyFlag: '-dirty'
]
Map runConfig = defaults + config
checkout scm
GIT_TAG = sh(
script: "git describe --tags --always --dirty=${runConfig.dirtyFlag}",
returnStdout: true
).trim()
return GIT_TAG
}

10
vars/packageStep.groovy Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env groovy
void call(Map config = [:]) {
Map defaults = [
artifacts: []
]
Map runConfig = defaults + config
echo "${runConfig}"
}