Skip to content

Instantly share code, notes, and snippets.

@sdhuang32
Created August 24, 2019 15:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sdhuang32/b64cda152c005487c151ee55e458ab2c to your computer and use it in GitHub Desktop.
Save sdhuang32/b64cda152c005487c151ee55e458ab2c 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
@IngmarBoddington
Copy link

Thanks for building this / sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment