forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script: add lib-build.sh for common high level funcs and no main
The intention of this file is collect some of the most basic or common shell functions used across the various build scripts. I would also like to ensure that functions added here are validated using `shellcheck`. Currently, there's no automation for this, just the honor system, but eventually we can start automating validating this and other scripts with shellcheck. Signed-off-by: John Mulligan <[email protected]>
- Loading branch information
1 parent
5f92f54
commit 29d9a82
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# lib-build.sh - A library of build and test bash shell functions. | ||
# | ||
# There should be few, or none, globals in this file beyond function | ||
# definitions. | ||
# | ||
# This script should be `shellcheck`ed. Please run shellcheck when | ||
# making changes to this script and use ignore comments | ||
# (ref: https://www.shellcheck.net/wiki/Ignore ) to explicitly mark | ||
# where a line is intentionally ignoring a typical rule. | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
|
||
# The following global only exists to help detect if lib-build has already been | ||
# sourced. This is only needed because the scripts that are being migrated are | ||
# often sourcing (as opposed to exec'ing one another). | ||
# shellcheck disable=SC2034 | ||
_SOURCED_LIB_BUILD=1 | ||
|
||
function in_jenkins() { | ||
[ -n "$JENKINS_HOME" ] | ||
} |
This file contains 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