-
Notifications
You must be signed in to change notification settings - Fork 279
/
build
executable file
·49 lines (39 loc) · 1.2 KB
/
build
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
#!/usr/bin/env bash
echo "---> Build: Simple Layers Buildpack"
set -o errexit
set -o nounset
set -o pipefail
launch_dir=$1
## makes a launch layer
echo "making launch layer"
# Add color line, to test for --no-color
echo "Color: [0mStyled"
mkdir "$launch_dir/launch-layer"
echo "Launch Dep Contents" > "$launch_dir/launch-layer/launch-dep"
ln -snf "$launch_dir/launch-layer" launch-deps
echo "launch = true" > "$launch_dir/launch-layer.toml"
## makes a cached launch layer
if [[ ! -f "$launch_dir/cached-launch-layer.toml" ]]; then
echo "making cached launch layer"
mkdir "$launch_dir/cached-launch-layer"
echo "Cached Dep Contents" > "$launch_dir/cached-launch-layer/cached-dep"
ln -snf "$launch_dir/cached-launch-layer" cached-deps
echo "launch = true" > "$launch_dir/cached-launch-layer.toml"
echo "cache = true" >> "$launch_dir/cached-launch-layer.toml"
else
echo "reusing cached launch layer"
ln -snf "$launch_dir/cached-launch-layer" cached-deps
fi
## adds a process
cat <<EOF > "$launch_dir/launch.toml"
[[processes]]
type = "web"
command = "./run"
args = ["8080"]
[[processes]]
type = "hello"
command = "echo"
args = ["hello", "world"]
direct = true
EOF
echo "---> Done"