Skip to content

Commit

Permalink
collect logs in tar
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Dec 10, 2019
1 parent 4b6a2c2 commit 19f5cb9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .buildkite/hooks/pre-artifact
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -euo pipefail

if [ "$BUILDKITE_PULL_REQUEST" == "false" ]; then
TARGET="$BUILDKITE_BRANCH"
else
TARGET="$BUILDKITE_PULL_REQUEST"
fi
TARGET="${TARGET//\//_}"

ARTIFACTS="buildkite.${BUILDKITE_ORGANIZATION_SLUG}.${TARGET}.${BUILD}.${BUILDKITE_STEP_KEY}"
ARTIFACTS_DIR="artifacts"
mkdir -p "$ARTIFACTS_DIR" artifacts.out
cp -R "bazel-testlogs" "$ARTIFACTS_DIR"
cp -R "logs" artifacts "$ARTIFACTS_DIR"
tar caf "$artifacts.out/$ARTIFACTS.tar.gz" -C artifacts "$ARTIFACTS"
4 changes: 1 addition & 3 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
set -euo pipefail

echo "Starting bazel remote cache proxy"

Expand All @@ -12,5 +12,3 @@ docker run -e BAZEL_REMOTE_S3_BUCKET=buildkite-bazel-cache\
-e BAZEL_REMOTE_S3_ACCESS_KEY_ID=$BAZEL_REMOTE_S3_ACCESS_KEY_ID\
-e BAZEL_REMOTE_S3_SECRET_ACCESS_KEY=$BAZEL_REMOTE_S3_SECRET_ACCESS_KEY\
--net=host -d buchgr/bazel-remote-cache
# To use it replace the bazelrc file
cp .bazelrc_ci .bazelrc
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
steps:
- label: ":bazel: Build scion code"
command:
- make -s GODEPS_SKIP=1 GOGEN_SKIP=1 all
- bazel --bazelrc=.bazelrc_ci build //:scion //:scion-ci
retry:
automatic:
- exit_status: -1 # Agent was lost
- exit_status: 255 # Forced agent shutdown
timeout_in_minutes: 10
- label: ":bazel: Go tests"
command:
- ./scion.sh test go
- bazel --bazelrc=.bazelrc_ci test //go/... --print_relative_test_log_paths
artifact_paths:
- "bazel-testlogs/**/*"
- "artifacts.out/**/*"
retry:
automatic:
- exit_status: -1 # Agent was lost
Expand Down

0 comments on commit 19f5cb9

Please sign in to comment.