forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-compile.sh
36 lines (32 loc) · 1.39 KB
/
post-compile.sh
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
#!/hint/bash
set -e
busyprograms=(
ambex
#entrypoint
kubestatus
watt
agent
)
sudo install -D -t /opt/ambassador/bin/ /buildroot/bin/busyambassador
for busyprogram in "${busyprograms[@]}"; do
# Create symlinks to the multi-call binary so the original names can be used in
# the builder shell easily (from the shell PATH).
ln -sf /buildroot/bin/busyambassador /buildroot/bin/"$busyprogram"
# Stuff in /opt/ambassador/bin in the builder winds up in /usr/local/bin in the
# production image.
sudo ln -sf /opt/ambassador/bin/busyambassador /opt/ambassador/bin/"$busyprogram"
done
sudo install /buildroot/bin/capabilities_wrapper /opt/ambassador/bin/wrapper
# Copy installer support into /opt/image-build to be run at docker build for the
# production image. Then run the installers for the builder container.
# Note: When this (ambassador's) post-compile runs, it always runs first, and
# every other post-compile runs as well. So this is the place to recreate the
# /opt/image-build tree from scratch so the builder container stays valid.
sudo rm -rf /opt/image-build
sudo install -D -t /opt/image-build /buildroot/ambassador/build-aux-local/install.sh
sudo cp -a /buildroot/ambassador/build-aux-local/installers /opt/image-build/
sudo /opt/image-build/install.sh
# run any extra, local post-compile task
if [ -f post-compile.local.sh ] ; then
bash post-compile.local.sh
fi