Jenkins shared library and CDK constructs for AWS infrastructure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
552 B
Groovy
36 lines
552 B
Groovy
/**
|
|
* 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
|
|
|