Skip to content

Instantly share code, notes, and snippets.

@dinedal
Created September 26, 2019 18:30
Show Gist options
  • Save dinedal/164ac4f5fd44bfb6ba212986de89c65d to your computer and use it in GitHub Desktop.
Save dinedal/164ac4f5fd44bfb6ba212986de89c65d to your computer and use it in GitHub Desktop.
Shell script that will generate a static copy of the dbt docs
#!/bin/bash
dbt docs generate
dbt docs serve &
DOCS_SERVER_PID=$!
sleep 2
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8080/); do
printf '.'
sleep 2
done
mkdir -p $1
curl --output $1/index.htm --silent http://127.0.0.1:8080/
curl --output $1/manifest.json --silent http://127.0.0.1:8080/manifest.json
curl --output $1/catalog.json --silent http://127.0.0.1:8080/catalog.json
curl --output $1/run_results.json --silent http://127.0.0.1:8080/run_results.json
kill $DOCS_SERVER_PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment