-
Notifications
You must be signed in to change notification settings - Fork 25
/
initial.yml
80 lines (70 loc) · 2.29 KB
/
initial.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This file is never read -- it's just a copy of the pipeline's
# configuration in the Buildkite UI.
steps:
- name: ":pipeline: rails-initial-pipeline"
command: |
PATH=/bin:/usr/bin
set -e
if [ -d ".buildkite" ]; then
echo "+++ :bk-status-failed: .buildkite/ already exists; please remove it and try again"
exit 1
fi
if [ -n "$$CONFIG_REPO" ]; then
GIT_REPO="$$CONFIG_REPO"
else
GIT_REPO="https://github.com/rails/buildkite-config"
fi
GIT_BRANCH="$${CONFIG_BRANCH-main}"
GIT_BRANCH="$${GIT_BRANCH#*:}"
echo "Cloning buildkite-config:"
echo "git clone -b \"$$GIT_BRANCH\" \"$$GIT_REPO\" .buildkite"
git clone -b "$$GIT_BRANCH" "$$GIT_REPO" .buildkite
rm -rf .buildkite/.git
echo "Fetching pull-request metadata:"
(docker run --rm \
-v "$$PWD":/app:ro -w /app \
-e GITHUB_PUBLIC_REPO_TOKEN \
-e BUILDKITE_REPO \
-e BUILDKITE_PULL_REQUEST \
ruby:latest \
.buildkite/bin/fetch-pr > .buildkite/tmp/.pr-meta.json) || true
echo "Generating pipeline:"
sh -c "$$PIPELINE_COMMAND"
([ -f .buildkite/.dockerignore ] && cp .buildkite/.dockerignore .dockerignore) || true
plugins:
- artifacts#v1.9.3:
upload: ".dockerignore"
- artifacts#v1.9.3:
upload:
- .buildkite/.empty
- .buildkite/docker-compose.yml
- .buildkite/Dockerfile
- .buildkite/Dockerfile.beanstalkd
- .buildkite/mysql-initdb.d
- .buildkite/runner
compressed: ".buildkite.tgz"
env:
BUNDLE_FROZEN: true
PIPELINE_COMMAND: >-
docker run --rm
-v "$$PWD":/app:ro -w /app
-e CI
-e BUILDKITE
-e BUILDKITE_AGENT_META_DATA_QUEUE
-e BUILDKITE_BRANCH
-e BUILDKITE_BUILD_ID
-e BUILDKITE_MESSAGE
-e BUILDKITE_PULL_REQUEST
-e BUILDKITE_PULL_REQUEST_BASE_BRANCH
-e BUILDKITE_REBUILT_FROM_BUILD_ID
-e BUILD_QUEUE
-e BUNDLE_FROZEN
-e DOCKER_IMAGE
-e RUN_QUEUE
-e QUEUE
ruby:latest
.buildkite/bin/pipeline-generate rails-ci |
buildkite-agent pipeline upload
timeout_in_minutes: 5
agents:
queue: "${QUEUE-builder}"