Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Avoid dropping script in build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Apr 12, 2022
1 parent becedce commit 66f670f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export DOCKERHUB_USERNAME=$(aws ssm get-parameters --names /apppack/account/dock
export DOCKERHUB_ACCESS_TOKEN=$(aws ssm get-parameters --names /apppack/account/dockerhub-access-token --with-decryption --query Parameters[0].Value --output text)
# extract build script
jq -r .source.buildspec < build.json > buildspec.yml
yj < buildspec.yml | jq -r .phases.install.commands > script.sh
yj < buildspec.yml | jq -r .phases.pre_build.commands >> script.sh
yj < buildspec.yml | jq -r .phases.build.commands >> script.sh
yj < buildspec.yml | jq -r .phases.install.commands > /tmp/script.sh
yj < buildspec.yml | jq -r .phases.pre_build.commands >> /tmp/script.sh
yj < buildspec.yml | jq -r .phases.build.commands >> /tmp/script.sh
rm build.json buildspec.yml
mkdir -p "$HOME" && git config --global --add safe.directory "$(pwd)"
# run build script
echo "::group::Running build process"
bash script.sh
bash /tmp/script.sh
echo "::endgroup::"
echo "Fixing file permissions"
find . -user 0 -maxdepth 1 -type f -exec chown 1001 {} +
Expand Down

0 comments on commit 66f670f

Please sign in to comment.