Skip to content

Commit e500449

Browse files
authored
Merge pull request #126 from kmala/env_dir
fix(env_dir): Remove directories from the env dir passed to the compile
2 parents 2e03d3f + e058fa2 commit e500449

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

rootfs/builder/build.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ app_dir=/app
1414
build_root=/tmp/build
1515
cache_root=/tmp/cache
1616
cache_file=/tmp/cache.tgz
17-
env_root=/tmp/env
17+
secret_dir=/tmp/env
18+
env_root=/tmp/environment
1819
buildpack_root=/tmp/buildpacks
1920

2021
mkdir -p $app_dir
2122
mkdir -p $cache_root
2223
mkdir -p $env_root
24+
mkdir -p $secret_dir
2325
mkdir -p $buildpack_root
2426
mkdir -p $build_root/.profile.d
2527

@@ -97,13 +99,19 @@ REQUEST_ID=$(openssl rand -base64 32)
9799
export REQUEST_ID
98100
export STACK=cedar-14
99101

102+
## copy the environment dir excluding the ephemeral ..data/ dir and other symlinks created by Kubernetes.
103+
104+
if [ "$(ls -A $secret_dir)" ]; then
105+
cp $secret_dir/* $env_root/
106+
fi
107+
100108
## SSH key configuration
101109

102-
if [[ -n "$SSH_KEY" ]]; then
110+
if [[ -f "$env_root/SSH_KEY" ]]; then
103111
mkdir -p ~/.ssh/
104112
chmod 700 ~/.ssh/
105113

106-
echo "$SSH_KEY" | base64 -d > ~/.ssh/id_rsa
114+
base64 -d "$env_root/SSH_KEY" > ~/.ssh/id_rsa
107115
chmod 400 ~/.ssh/id_rsa
108116

109117
echo 'StrictHostKeyChecking=no' > ~/.ssh/config

0 commit comments

Comments
 (0)