Skip to content

Instantly share code, notes, and snippets.

@focusaurus
Created January 26, 2017 02:49
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 focusaurus/0cb0290d65335ed240445a00dc6fbd63 to your computer and use it in GitHub Desktop.
Save focusaurus/0cb0290d65335ed240445a00dc6fbd63 to your computer and use it in GitHub Desktop.
Build script detects macOS and runs itself under docker
#!/usr/bin/env bash
cd "$(dirname "$0")/.."
if [[ "$(uname)" == "Darwin" ]]; then
docker build --tag foo-rpmbuild .
docker run --interactive --tty --rm \
--volume "${PWD}:/opt/docker-host" \
--volume "$(yarn cache dir | grep '^/'):/var/run/yarn-cache" \
foo-rpmbuild /opt/docker-host/bin/build.sh
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment