Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alanedwardes/4c4e7a7107853b0310e26e3f09c9ac61 to your computer and use it in GitHub Desktop.
Save alanedwardes/4c4e7a7107853b0310e26e3f09c9ac61 to your computer and use it in GitHub Desktop.
// 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