Skip to content

Instantly share code, notes, and snippets.

@mcsf
Last active August 9, 2020 19:17
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 mcsf/60385b1a2f712f50ef756cb0bdc8ef21 to your computer and use it in GitHub Desktop.
Save mcsf/60385b1a2f712f50ef756cb0bdc8ef21 to your computer and use it in GitHub Desktop.
set -e
# Clean
if pgrep -f Docker.app ; then
echo "Please manually quit Docker and try again."
exit 1
fi
# Prep
echo "Starting Docker daemon…"
open -a Docker
echo "Waiting for Docker to be ready…"
timeout 60 sh -c "until docker info; do echo .; sleep 1; done" &> /dev/null
echo "Starting wp-env…"
npx wp-env start &> /dev/null
# Run
echo "Updating NPM dependencies…"
npm ci &> /dev/null
echo "Building Gutenberg…"
npm run build &> /dev/null
# Measure
echo "Done."
echo "Collecting resource stats…:"
echo "-- at 0 seconds"
ps -ro comm,pcpu,time -p $(pgrep -f Docker.app)
sleep 30
echo "-- at 30 seconds"
ps -ro comm,pcpu,time -p $(pgrep -f Docker.app)
sleep 30
echo "-- at 60 seconds"
ps -ro comm,pcpu,time -p $(pgrep -f Docker.app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment