Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IngmarBoddington/ef109a5e61e8277396bebf89373ca5c5 to your computer and use it in GitHub Desktop.
Save IngmarBoddington/ef109a5e61e8277396bebf89373ca5c5 to your computer and use it in GitHub Desktop.
#!/bin/bash
BASE_DIR=$(dirname $0)
BUILD_SCRIPT_NAME="build-git.sh"
BUILD_SCRIPT="${BASE_DIR}/${BUILD_SCRIPT_NAME}"
if [ ! -d /share/Public/toolchain ]; then
mkdir /share/Public/toolchain
fi
if [ -z "$(system-docker ps | grep 'builder')" ]; then
system-docker run --name builder --privileged -v /share/Public/toolchain:/share/Public/toolchain -d sdhuang32/c7-systemd
fi
system-docker cp ${BUILD_SCRIPT} builder:/root/${BUILD_SCRIPT_NAME}
system-docker exec -t builder bash /root/${BUILD_SCRIPT_NAME}
if [ -z "$(cat /etc/profile | grep 'toolchain')" ]; then
echo "PATH=/share/Public/toolchain/bin:\$PATH" >> /etc/profile
fi
system-docker stop builder; system-docker rm builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment