Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ def wrap = { fn->
variable: 'GOOGLE_APPLICATION_CREDENTIALS_OVERRIDE')]) {
withCredentials([string(credentialsId: 'newrelic.license.key',
variable: 'NEWRELIC_LICENSE_KEY_OVERRIDE')]) {
sh ("""
cp env.sh.sample env.sh
rm -rf build
mkdir build
""")
sh ("bin/clean-workspace.sh")
fn()
}
}
Expand Down
25 changes: 25 additions & 0 deletions bin/clean-workspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# clean workspace
#
# Set bash unofficial strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail

# Set DEBUG to true for enhanced debugging: run prefixed with "DEBUG=true"
${DEBUG:-false} && set -vx
# Credit to https://stackoverflow.com/a/17805088
# and http://wiki.bash-hackers.org/scripting/debuggingtips
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

# Credit to http://stackoverflow.com/a/246128/424301
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASE_DIR="$DIR/.."
BUILD_DIR="$BASE_DIR/build"
export BASE_DIR

# shellcheck disable=SC1090
. "$DIR/common.sh"

cp "$BASE_DIR/env.sh.sample" "$BASE_DIR/env.sh"
clean_root_owned_docker_files
rm -rf "$BUILD_DIR"
mkdir "$BUILD_DIR"
2 changes: 1 addition & 1 deletion bin/codedeploy/AfterInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

# Credit to http://stackoverflow.com/a/246128/424301
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASE_DIR="$DIR/.."
BASE_DIR="$DIR/../.."
ANSIBLE_DIR="$BASE_DIR/ansible"

# Invoke Ansible for final set up
Expand Down
2 changes: 1 addition & 1 deletion bin/codedeploy/ApplicationStart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

# Credit to http://stackoverflow.com/a/246128/424301
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASE_DIR="$DIR/.."
BASE_DIR="$DIR/../.."
ANSIBLE_DIR="$BASE_DIR/ansible"

# Invoke Ansible for final set up
Expand Down