Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Checkout and store away result
def checkoutResult = scm checkout
// Build a human readable build label
def buildLabel = [env.EstPlatform, checkoutResult.GIT_COMMIT.substring(0, 6), env.JOB_NAME, env.BUILD_NUMBER].join('-')
// Stamp the build config header file
def configFile = 'Depot/Source/EstCore/EstBuildConfig.h'
def buildConfig = readFile file: configFile
buildConfig += '\n#undef BUILD_COMMIT'
buildConfig += '\n#define BUILD_COMMIT "' + checkoutResult.GIT_COMMIT + '"'
buildConfig += '\n#undef BUILD_LABEL'
buildConfig += '\n#define BUILD_LABEL "' + buildLabel + '"'
writeFile file: configFile, text: buildConfig
// Compile, package, deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.