Skip to content

Commit

Permalink
Merge pull request #126 from kmala/env_dir
Browse files Browse the repository at this point in the history
fix(env_dir): Remove directories from the env dir passed to the compile
  • Loading branch information
kmala authored Dec 14, 2016
2 parents 2e03d3f + e058fa2 commit e500449
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rootfs/builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ app_dir=/app
build_root=/tmp/build
cache_root=/tmp/cache
cache_file=/tmp/cache.tgz
env_root=/tmp/env
secret_dir=/tmp/env
env_root=/tmp/environment
buildpack_root=/tmp/buildpacks

mkdir -p $app_dir
mkdir -p $cache_root
mkdir -p $env_root
mkdir -p $secret_dir
mkdir -p $buildpack_root
mkdir -p $build_root/.profile.d

Expand Down Expand Up @@ -97,13 +99,19 @@ REQUEST_ID=$(openssl rand -base64 32)
export REQUEST_ID
export STACK=cedar-14

## copy the environment dir excluding the ephemeral ..data/ dir and other symlinks created by Kubernetes.

if [ "$(ls -A $secret_dir)" ]; then
cp $secret_dir/* $env_root/
fi

## SSH key configuration

if [[ -n "$SSH_KEY" ]]; then
if [[ -f "$env_root/SSH_KEY" ]]; then
mkdir -p ~/.ssh/
chmod 700 ~/.ssh/

echo "$SSH_KEY" | base64 -d > ~/.ssh/id_rsa
base64 -d "$env_root/SSH_KEY" > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa

echo 'StrictHostKeyChecking=no' > ~/.ssh/config
Expand Down

0 comments on commit e500449

Please sign in to comment.