Initial commit: Spicy CDK automation framework
Jenkins shared library and CDK constructs for AWS infrastructure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
35
vars/gitUtils.groovy
Normal file
35
vars/gitUtils.groovy
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Git utilities for Spicy CDK pipelines
|
||||
*/
|
||||
|
||||
def getRemoteURL() {
|
||||
return sh(
|
||||
script: 'git config --get remote.origin.url',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
||||
|
||||
def getSHA() {
|
||||
return sh(
|
||||
script: 'git rev-parse HEAD',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
||||
|
||||
def getShortSHA() {
|
||||
return sh(
|
||||
script: 'git rev-parse --short HEAD',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
||||
|
||||
def isMain() {
|
||||
return "${BRANCH_NAME}" == "main" || "${BRANCH_NAME}" == "master"
|
||||
}
|
||||
|
||||
def getBranchName() {
|
||||
return env.CHANGE_BRANCH ?: env.BRANCH_NAME
|
||||
}
|
||||
|
||||
return this
|
||||
|
||||
Reference in New Issue
Block a user