Repository: bigtop Updated Branches: refs/heads/master 8bfc86690 -> 42146ecbf
BIGTOP-2758. [Sandbox] Support dryrun in build script Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/42146ecb Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/42146ecb Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/42146ecb Branch: refs/heads/master Commit: 42146ecbf84f87b327598615349a7c7c1b0dd847 Parents: 8bfc866 Author: Evans Ye <[email protected]> Authored: Sat May 6 11:49:22 2017 +0000 Committer: Evans Ye <[email protected]> Committed: Thu May 11 03:07:56 2017 +0800 ---------------------------------------------------------------------- docker/sandbox/build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/42146ecb/docker/sandbox/build.sh ---------------------------------------------------------------------- diff --git a/docker/sandbox/build.sh b/docker/sandbox/build.sh index 8936fd0..8676250 100755 --- a/docker/sandbox/build.sh +++ b/docker/sandbox/build.sh @@ -135,6 +135,10 @@ show_deploy_configs() { echo "-------------------------------------------------" } +log() { + echo -e "\n[LOG] $1\n" +} + usage() { echo "usage: $PROG args" echo " -a, --account Specify account name for image." @@ -158,6 +162,9 @@ while [ $# -gt 0 ]; do fi ACCOUNT=$2 shift 2;; + -d|--dryrun) + DRYRUN=true + shift;; -c|--components) if [ $# -lt 2 ]; then usage @@ -203,7 +210,7 @@ else if [ -f "$FILE" ]; then cp -vfr $FILE site.yaml.template else - echo "$FILE not exist!" + log "$FILE not exist!" exit 1 fi fi @@ -211,5 +218,10 @@ fi export ACCOUNT export TAG generate_dockerfile +if [ "$DRYRUN" == true ]; then + log "Generated Dockerfile:" + cat Dockerfile + exit 0 +fi build cleanup
