Created
October 2, 2018 06:38
-
-
Save icy/ce854bd753abb8a8291fcdc07b61541a to your computer and use it in GitHub Desktop.
Jenkinsfile.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
// Purpose: A Sample Jenkinsfile.groovy | |
// Author : Ky-Anh Huynh | |
// License: MIT | |
@Library("libs@default_branch") | |
def slack = new org.gfg.Slack() | |
try { | |
// Preamble | |
send_notification | |
prepare_worker_configuration_as_user | |
prepare_worker_configuration_as_root | |
fix_local_git_configuration | |
store_locking_states | |
store_build_states_for_future_reference | |
node("some_nodes") { | |
// a lot of stuff here | |
} | |
} | |
catch (exc) { | |
currentBuild.result = currentBuild.result ?: "FAILED" | |
echo "Caught: ${exc}" | |
throw exc | |
} | |
finally { | |
// Clean Up | |
send_notification | |
remove_locking_status | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment