Skip to content

Commit ac423a7

Browse files
committed
chore(pack-images): change dep dir
1 parent f1935de commit ac423a7

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

buildpacks/python/bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ elif [[ -f requirements.txt ]]; then
6565
python -m pip install -r requirements.txt \
6666
--exists-action=w --src="${python_layer_dir}"/src \
6767
--disable-pip-version-check --no-cache-dir
68-
scanelp "${python_layer_dir}" > .auto-deps
68+
scanelp "${python_layer_dir}" > "${BASE_LAYER}"/deps/.auto-deps
6969
generate_deps_layer auto-deps
7070
fi
7171

buildpacks/ruby/bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [[ -f Gemfile.lock && "${local_bundler_checksum}" == "${remote_bundler_checks
3333
else
3434
echo "---> Installing gems"
3535
bundle install
36-
scanelp "${bundler_layer_dir}" > .auto-deps
36+
scanelp "${bundler_layer_dir}" > "${BASE_LAYER}"/deps/.auto-deps
3737
generate_deps_layer auto-deps
3838
fi
3939
cat >"${bundler_layer_dir}.toml" <<EOL

rootfs/usr/local/bin/generate-layers.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,23 @@ EOL
5151
}
5252

5353
generate_base_layer() {
54-
base_layer="${layers_dir}"/base
55-
mkdir -p "${base_layer}/profile.d"
56-
cat > "${base_layer}/profile.d/link.sh" <<EOL
54+
BASE_LAYER="${layers_dir}"/base
55+
mkdir -p "${BASE_LAYER}/deps"
56+
if [ -e .build-deps ]; then
57+
cp .build-deps "${BASE_LAYER}/deps"
58+
fi
59+
if [ -e .run-deps ]; then
60+
cp .run-deps "${BASE_LAYER}/deps"
61+
fi
62+
mkdir -p "${BASE_LAYER}/profile.d"
63+
cat > "${BASE_LAYER}/profile.d/link.sh" <<EOL
5764
rm -rf /opt/drycc
5865
ln -s "${layers_dir}" /opt/drycc
5966
echo "include ${layers_dir}/*/etc/ld.so.conf.d/*.conf" > /etc/ld.so.conf.d/drycc.conf
6067
sudo ldconfig
6168
EOL
62-
bash "${base_layer}/profile.d/link.sh"
63-
cat > "${base_layer}.toml" <<EOL
69+
bash "${BASE_LAYER}/profile.d/link.sh"
70+
cat > "${BASE_LAYER}.toml" <<EOL
6471
[types]
6572
cache = true
6673
build = true
@@ -69,11 +76,12 @@ launch = true
6976
[metadata]
7077
version = "1.0.0"
7178
EOL
79+
export BASE_LAYER
7280
}
7381

7482
generate_deps_layer() {
7583
local deps_type="$1"
76-
local deps_file=."$deps_type"
84+
local deps_file="${BASE_LAYER}"/deps/."$deps_type"
7785
local deps_layer_dir="${layers_dir}"/"$deps_type"
7886
if [[ -f "${deps_file}" && $(<"${deps_file}") != "" ]]; then
7987
echo "---> Generate ${deps_type} layer"

rootfs/usr/local/bin/install-packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#fake install-packages
44
LAYERS_DIR="${LAYERS_DIR:?LAYERS_DIR is required}"
55
STACK_NAME="${STACK_NAME:?STACK_NAME is required}"
6-
echo "$@" | tr ' ' '\n' | sort -u -o ."${STACK_NAME}"-deps
6+
echo "$@" | tr ' ' '\n' | sort -u -o "${BASE_LAYER}"/deps/."${STACK_NAME}"-deps
77
. generate-layers.sh "${LAYERS_DIR}"
88
generate_deps_layer "${STACK_NAME}"-deps

0 commit comments

Comments
 (0)