-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpipeline.rb
82 lines (68 loc) · 1.91 KB
/
pipeline.rb
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
81
82
Buildkite::Builder.pipeline do
# You can require files from the `.buildkite/lib` directory because it's
# automatically added to the Ruby load path.
require 'cool_lib'
use(MyCoolExtension) do
pipeline do
command do
label 'Appended Step'
command 'echo 1'
end
end
end
use(ExtensionWithDsl)
CoolLib.resolve(context.logger)
env CI: "1"
env DEPLOYABLE: "1"
notify email: "dev@acmeinc.com"
notify basecamp_campfire: "https://3.basecamp.com/1234567/integrations/qwertyuiop/buckets/1234567/chats/1234567/lines"
# Register a plugin for steps to use.
plugin :skip_checkout, 'thedyrt/skip-checkout#v0.1.1'
command do
label "Step w/ Plugin"
key :step_with_plugin
command "true"
# Reference the plugin by its assigned name.
plugin :skip_checkout
end
group do
label "Cool Group", emoji: :partyparrot
# Load the "rspec" template as a command.
# .buildkite/pipelines/showcase/templates/rspec.rb
command(:rspec)
# Load the "rspec" template and modify it on the fly.
command(:rspec) do
label "RSpec relabeled"
command "echo 'do something else'"
plugin :skip_checkout
end
depends_on :step_with_plugin
key :cool_group
end
component("Cool Component") do
command(:generic, foo: "Bar")
end
# Pass arguments into templates.
command(:generic, foo: "Foo1")
command(:generic, foo: "Foo2")
# Add complex conditions based on your cobebase as to whether or not a step
# should be defined.
if true == false
command do
label "This won't run"
command "true"
end
end
# Add a wait step.
wait
# Add a skipped step. You can see this step when you click the "eye" icon on
# the Buildkite web UI.
command do
command "true"
label "Skipped Step"
# Conditionally skip a step.
if true == true
skip "This step is skipped because of x, y, and z"
end
end
end