File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # This script is used to upload the full buildkite pipeline. The steps defined
4
+ # in the buildkite UI should simply be:
5
+ #
6
+ # steps:
7
+ # - command: ".buildkite/pipeline-upload.sh"
8
+ #
9
+
10
+ set -e
11
+ cd " $( dirname " $0 " ) " /..
12
+ source ci/_
13
+
14
+ _ ci/buildkite-pipeline.sh pipeline.yml
15
+ echo +++ pipeline
16
+ cat pipeline.yml
17
+
18
+ _ buildkite-agent pipeline upload pipeline.yml
Original file line number Diff line number Diff line change
1
+ # Buildkite log management helper
2
+ #
3
+ # See https://buildkite.com/docs/pipelines/managing-log-output
4
+ #
5
+ # |source| me
6
+ #
7
+
8
+ base_dir=$(realpath --strip "$(dirname "$0")/..")
9
+
10
+ _() {
11
+ if [[ $(pwd) = $base_dir ]]; then
12
+ echo "--- $*"
13
+ else
14
+ echo "--- $* (wd: $(pwd))"
15
+ fi
16
+ "$@"
17
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Builds a buildkite pipeline based on the environment variables
4
+ #
5
+
6
+ set -e
7
+ cd " $( dirname " $0 " ) " /..
8
+
9
+ output_file=${1:-/ dev/ stderr}
10
+
11
+ if [[ -n $CI_PULL_REQUEST ]]; then
12
+ IFS=' :' read -ra affected_files <<< " $(buildkite-agent meta-data get affected_files)"
13
+ if [[ ${# affected_files[*]} -eq 0 ]]; then
14
+ echo " Unable to determine the files affected by this PR"
15
+ exit 1
16
+ fi
17
+ else
18
+ affected_files=()
19
+ fi
20
+
21
+ start_pipeline () {
22
+ echo " # $* " > " $output_file "
23
+ echo " steps:" >> " $output_file "
24
+ }
25
+
26
+ wait_step () {
27
+ echo " - wait" >> " $output_file "
28
+ }
29
+
30
+ start_pipeline " Push pipeline for ${BUILDKITE_BRANCH:- ?unknown branch?} "
31
+ wait_step
32
+ exit 0
You can’t perform that action at this time.
0 commit comments