To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / deploy / any / run-provisioning.sh @ 1607:1c904260787b
History | View | Annotate | Download (653 Bytes)
| 1 | 1601:07deb8466f65 | Chris | #!/bin/bash |
|---|---|---|---|
| 2 | |||
| 3 | mydir=$(dirname "$0") |
||
| 4 | 1603:455ca6e45c49 | Chris | case "$mydir" in |
| 5 | /*) ;; |
||
| 6 | *) mydir=$(echo "$(pwd)/$mydir" | sed 's,/\./,/,g') |
||
| 7 | esac |
||
| 8 | 1601:07deb8466f65 | Chris | |
| 9 | if [ "$mydir" != "/code-to-deploy/deploy/any" ]; then |
||
| 10 | echo "ERROR: Expected repository to be at /code-to-deploy prior to provisioning" |
||
| 11 | 1603:455ca6e45c49 | Chris | echo " (My directory is $mydir, expected /code-to-deploy/deploy/any)" |
| 12 | 1601:07deb8466f65 | Chris | exit 2 |
| 13 | fi |
||
| 14 | |||
| 15 | 1604:2162f6ff8580 | Chris | set -e |
| 16 | |||
| 17 | . "$mydir"/prepare.sh |
||
| 18 | 1601:07deb8466f65 | Chris | |
| 19 | for f in "$mydir"/../provision.d/[0-9]*.sh ; do |
||
| 20 | case "$f" in |
||
| 21 | *~) ;; |
||
| 22 | *) echo "Running provisioning script: $f" |
||
| 23 | 1605:18643ab36008 | Chris | /bin/bash "$f" </dev/null ;; # close stdin to avoid interactivity |
| 24 | 1601:07deb8466f65 | Chris | esac |
| 25 | done |
||
| 26 | |||
| 27 | echo "All provisioning scripts complete" |