Skip to content

Commit

Permalink
Don't change working directory when running plugin (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGreen authored Aug 25, 2022
1 parent 336fbb2 commit 73b5e4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install
PLUGIN_BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"

bundle install --quiet --gemfile="${PLUGIN_BASEDIR}/Gemfile"

# Do any other automated setup that you need to do here
10 changes: 5 additions & 5 deletions hooks/post-command
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eEuo pipefail

DOCKER_REPO=bugcrowd/test-summary-buildkite-plugin


on_failure() {
echo "Command failed with exit status: $?"
if [[ "${BUILDKITE_PLUGIN_TEST_SUMMARY_FAIL_ON_ERROR:-false}" != "true" ]]; then
Expand All @@ -14,12 +15,11 @@ on_failure() {

trap on_failure ERR

# cd to plugin directory
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
PLUGIN_BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"

if [[ ${BUILDKITE_PLUGIN_TEST_SUMMARY_RUN_WITHOUT_DOCKER:-false} = true ]]; then
./bin/setup
./bin/run
$PLUGIN_BASEDIR/bin/setup
$PLUGIN_BASEDIR/bin/run
else
TAG=$(git describe --tags --exact-match 2> /dev/null || true)

Expand All @@ -30,7 +30,7 @@ else
else
echo "No tag found, building image locally"
IMAGE=test-summary:$BUILDKITE_JOB_ID
docker build -t "$IMAGE" .
docker build -t "$IMAGE" $PLUGIN_BASEDIR
fi

docker run --rm \
Expand Down

0 comments on commit 73b5e4f

Please sign in to comment.