Skip to content

Commit f77148a

Browse files
committed
Changes for compatibility with Buildpack API 0.6
Signed-off-by: Sampark Sharma <[email protected]>
1 parent d4c4b91 commit f77148a

File tree

7 files changed

+25
-13
lines changed

7 files changed

+25
-13
lines changed

content/docs/buildpack-author-guide/create-buildpack/adding-bill-of-materials.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
7676
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
7777

7878
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
79-
echo -e 'launch = true' > "$layersdir/ruby.toml"
79+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
8080

8181
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
8282
export PATH="$rubylayer"/bin:$PATH
@@ -102,6 +102,7 @@ else
102102
echo "---> Installing gems"
103103
mkdir -p "$bundlerlayer"
104104
cat > "$layersdir/bundler.toml" <<EOL
105+
[types]
105106
cache = true
106107
launch = true
107108
@@ -118,6 +119,7 @@ cat > "$layersdir/launch.toml" <<EOL
118119
[[processes]]
119120
type = "web"
120121
command = "bundle exec ruby app.rb"
122+
default = true
121123
122124
# our worker process
123125
[[processes]]

content/docs/buildpack-author-guide/create-buildpack/build-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This code uses the `wget` tool to download the Ruby binaries from the given URL,
4747
The last step in creating a layer is writing a TOML file that contains metadata about the layer. The TOML file's name must match the name of the layer (in this example it's `ruby.toml`). Without this file, the Buildpack lifecycle will ignore the layer directory. For the Ruby layer, we need to ensure it is available in the launch image by setting the `launch` key to `true`. Add the following code to the build script:
4848

4949
```bash
50-
echo -e 'launch = true' > "$layersdir/ruby.toml"
50+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
5151
```
5252

5353
### Installing Dependencies
@@ -96,7 +96,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
9696
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
9797

9898
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
99-
echo -e 'launch = true' > "$layersdir/ruby.toml"
99+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
100100

101101
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
102102
export PATH="$rubylayer"/bin:$PATH

content/docs/buildpack-author-guide/create-buildpack/building-blocks-cnb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Example:
1717
<!-- test:exec -->
1818
```bash
1919
pack buildpack new examples/ruby \
20-
--api 0.5 \
20+
--api 0.6 \
2121
--path ruby-buildpack \
2222
--version 0.0.1 \
2323
--stacks io.buildpacks.samples.stacks.bionic
@@ -40,7 +40,7 @@ You will have `buildpack.toml` in your buildpack directory to describe our build
4040
<!-- test:file=ruby-buildpack/buildpack.toml -->
4141
```toml
4242
# Buildpack API version
43-
api = "0.5"
43+
api = "0.6"
4444

4545
# Buildpack ID and metadata
4646
[buildpack]

content/docs/buildpack-author-guide/create-buildpack/caching.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ with the following:
2222
echo "---> Installing gems"
2323
bundlerlayer="$layersdir/bundler"
2424
mkdir -p "$bundlerlayer"
25-
echo -e 'cache = true\nlaunch = true' > "$layersdir/bundler.toml"
25+
echo -e '[types]\ncache = true\nlaunch = true' > "$layersdir/bundler.toml"
2626
bundle config set --local path "$bundlerlayer" && bundle install && bundle binstubs --all --path "$bundlerlayer/bin"
2727

2828
```
@@ -49,7 +49,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
4949
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
5050

5151
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
52-
echo -e 'launch = true' > "$layersdir/ruby.toml"
52+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
5353

5454
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
5555
export PATH="$rubylayer"/bin:$PATH
@@ -64,7 +64,7 @@ gem install bundler --no-ri --no-rdoc
6464
echo "---> Installing gems"
6565
bundlerlayer="$layersdir/bundler"
6666
mkdir -p "$bundlerlayer"
67-
echo -e 'cache = true\nlaunch = true' > "$layersdir/bundler.toml"
67+
echo -e '[types]\ncache = true\nlaunch = true' > "$layersdir/bundler.toml"
6868
bundle config set --local path "$bundlerlayer" && bundle install && bundle binstubs --all --path "$bundlerlayer/bin"
6969

7070
# 8. SET DEFAULT START COMMAND
@@ -73,6 +73,7 @@ cat > "$layersdir/launch.toml" <<EOL
7373
[[processes]]
7474
type = "web"
7575
command = "bundle exec ruby app.rb"
76+
default = true
7677
7778
# our worker process
7879
[[processes]]
@@ -136,7 +137,7 @@ Replace the gem installation logic from the previous step:
136137
echo "---> Installing gems"
137138
bundlerlayer="$layersdir/bundler"
138139
mkdir -p "$bundlerlayer"
139-
echo -e 'cache = true\nlaunch = true' > "$layersdir/bundler.toml"
140+
echo -e '[types]\ncache = true\nlaunch = true' > "$layersdir/bundler.toml"
140141
bundle config set --local path "$bundlerlayer" && bundle install && bundle binstubs --all --path "$bundlerlayer/bin"
141142

142143

@@ -165,6 +166,7 @@ else
165166
echo "---> Installing gems"
166167
mkdir -p "$bundlerlayer"
167168
cat > "$layersdir/bundler.toml" <<EOL
169+
[types]
168170
cache = true
169171
launch = true
170172
@@ -198,7 +200,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
198200
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
199201
200202
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
201-
echo -e 'launch = true' > "$layersdir/ruby.toml"
203+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
202204
203205
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
204206
export PATH="$rubylayer"/bin:$PATH
@@ -225,6 +227,7 @@ else
225227
echo "---> Installing gems"
226228
mkdir -p "$bundlerlayer"
227229
cat > "$layersdir/bundler.toml" <<EOL
230+
[types]
228231
cache = true
229232
launch = true
230233
@@ -241,6 +244,7 @@ cat > "$layersdir/launch.toml" <<EOL
241244
[[processes]]
242245
type = "web"
243246
command = "bundle exec ruby app.rb"
247+
default = true
244248
245249
# our worker process
246250
[[processes]]

content/docs/buildpack-author-guide/create-buildpack/make-app-runnable.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ cat > "$layersdir/launch.toml" <<EOL
1515
[[processes]]
1616
type = "web"
1717
command = "bundle exec ruby app.rb"
18+
default = true
1819
EOL
1920

2021
# ...
@@ -42,7 +43,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
4243
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
4344

4445
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
45-
echo -e 'launch = true' > "$layersdir/ruby.toml"
46+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
4647

4748
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
4849
export PATH="$rubylayer"/bin:$PATH
@@ -62,6 +63,7 @@ cat > "$layersdir/launch.toml" <<EOL
6263
[[processes]]
6364
type = "web"
6465
command = "bundle exec ruby app.rb"
66+
default = true
6567
EOL
6668
```
6769

content/docs/buildpack-author-guide/create-buildpack/make-buildpack-configurable.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
6363
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
6464

6565
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
66-
echo -e 'launch = true' > "$layersdir/ruby.toml"
66+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
6767

6868
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
6969
export PATH="$rubylayer"/bin:$PATH
@@ -89,6 +89,7 @@ else
8989
echo "---> Installing gems"
9090
mkdir -p "$bundlerlayer"
9191
cat > "$layersdir/bundler.toml" <<EOL
92+
[types]
9293
cache = true
9394
launch = true
9495
@@ -105,6 +106,7 @@ cat > "$layersdir/launch.toml" <<EOL
105106
[[processes]]
106107
type = "web"
107108
command = "bundle exec ruby app.rb"
109+
default = true
108110
109111
# our worker process
110112
[[processes]]

content/docs/buildpack-author-guide/create-buildpack/specify-multiple-process-types.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cat > "$layersdir/launch.toml" <<EOL
2828
[[processes]]
2929
type = "web"
3030
command = "bundle exec ruby app.rb"
31+
default = true
3132
3233
# our worker process
3334
[[processes]]
@@ -60,7 +61,7 @@ ruby_url=https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/rub
6061
wget -q -O - "$ruby_url" | tar -xzf - -C "$rubylayer"
6162

6263
# 4. MAKE RUBY AVAILABLE DURING LAUNCH
63-
echo -e 'launch = true' > "$layersdir/ruby.toml"
64+
echo -e '[types]\nlaunch = true' > "$layersdir/ruby.toml"
6465

6566
# 5. MAKE RUBY AVAILABLE TO THIS SCRIPT
6667
export PATH="$rubylayer"/bin:$PATH
@@ -81,6 +82,7 @@ cat > "$layersdir/launch.toml" <<EOL
8182
[[processes]]
8283
type = "web"
8384
command = "bundle exec ruby app.rb"
85+
default = true
8486
8587
# our worker process
8688
[[processes]]

0 commit comments

Comments
 (0)