-
Notifications
You must be signed in to change notification settings - Fork 10
/
compile.env.erb
39 lines (32 loc) · 1.09 KB
/
compile.env.erb
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
#!/bin/bash
# shellcheck disable=1090
source "${BOSH_PACKAGES_DIR:-/var/vcap/packages}/${PACKAGE_NAME}/bosh/runtime.env"
# Use Clang if available; the resulting Ruby is faster
if [ -x /usr/bin/clang ]; then
export CXX=/usr/bin/clang++ CC=/usr/bin/clang
fi
bosh_bundle() {
bundle config set --local no_prune 'true'
bundle config set --local without 'development test'
bundle config set --local path "${BOSH_INSTALL_TARGET}/gem_home"
bundle install \
--binstubs "${BOSH_INSTALL_TARGET}/bin" \
"$@"
}
bosh_bundle_local() {
bundle config set --local no_prune 'true'
bundle config set --local without 'development test'
bundle config set --local path "${BOSH_INSTALL_TARGET}/gem_home"
bundle install \
--local \
--binstubs "${BOSH_INSTALL_TARGET}/bin" \
"$@"
}
bosh_generate_runtime_env() {
mkdir -p "${BOSH_INSTALL_TARGET}/bosh"
cat > "${BOSH_INSTALL_TARGET}/bosh/runtime.env" <<EOF
export PATH=${BOSH_INSTALL_TARGET}/bin:\$PATH
export GEM_HOME=${BOSH_INSTALL_TARGET}/gem_home/ruby/<%= ruby_patch_version %>
export BUNDLE_GEMFILE=${BOSH_INSTALL_TARGET}/Gemfile
EOF
}