Skip to content

Instantly share code, notes, and snippets.

@ferico55
Created May 4, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferico55/13c0ba4141797e31a096d1ade8fc9e47 to your computer and use it in GitHub Desktop.
Save ferico55/13c0ba4141797e31a096d1ade8fc9e47 to your computer and use it in GitHub Desktop.
def workspaceSha
node('native') {
stage ('setup workspace') {
def sha = sh(
script: "echo -n '${env.JOB_NAME}-${env.BUILD_NUMBER}' | shasum -a 256",
returnStdout: true
)
workspaceSha = sha.take(10)
}
}
pipeline {
agent {
node {
label 'native'
customWorkspace "/j/d1/${workspaceSha}"
}
}
stages {
# everything else here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment