Skip to content

Instantly share code, notes, and snippets.

@argami
Last active January 20, 2022 20:24
Show Gist options
  • Save argami/2e76cf5ae4ac98d7f9cc6dae8280f89e to your computer and use it in GitHub Desktop.
Save argami/2e76cf5ae4ac98d7f9cc6dae8280f89e to your computer and use it in GitHub Desktop.
#!/bin/bash
wait-for-url() {
timeout 90 \
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://app.lvh.me:3000/users/sign_in)" != "200" ]]; do echo "$(curl -s -o /dev/null -w ''%{http_code}'' app.lvh.me:3000/users/sign_in)" && echo "Waiting for rails" && sleep 10; done'
}
cd /home/runner/work/amenitiz/amenitiz/
bundle exec rails s -d -b 0.0.0.0
wait-for-url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment