Created
August 24, 2019 15:33
-
-
Save sdhuang32/b64cda152c005487c151ee55e458ab2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
Thanks for building this / sharing!