Scott Baker | 5547131 | 2015-05-12 11:15:10 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Andy Bavier | 21f243a | 2015-04-24 13:19:47 -0400 | [diff] [blame] | 2 | |
| 3 | TMPDIR="/tmp/initdata" |
| 4 | XOSDIR="/home/ubuntu/xos" |
| 5 | |
| 6 | mkdir -p $TMPDIR |
| 7 | rm -f $TMPDIR/*.json |
| 8 | |
| 9 | XOS=$( docker ps|grep "xos:latest"|awk '{print $NF}' ) |
| 10 | docker exec $XOS /opt/xos/scripts/opencloud dumpdata |
| 11 | docker cp $XOS:/opt/xos_backups/dumpdata-latest.json $TMPDIR |
Scott Baker | 5547131 | 2015-05-12 11:15:10 -0700 | [diff] [blame] | 12 | docker cp $XOS:/opt/xos/xos_config $TMPDIR |
Andy Bavier | 21f243a | 2015-04-24 13:19:47 -0400 | [diff] [blame] | 13 | cp $TMPDIR/*.json $XOSDIR/xos/core/fixtures/initial_data.json |
Scott Baker | 5547131 | 2015-05-12 11:15:10 -0700 | [diff] [blame] | 14 | cp $TMPDIR/xos_config $XOSDIR/xos/ |
Andy Bavier | 21f243a | 2015-04-24 13:19:47 -0400 | [diff] [blame] | 15 | |
| 16 | git pull |
Scott Baker | 5547131 | 2015-05-12 11:15:10 -0700 | [diff] [blame] | 17 | |
| 18 | if [[ $? != 0 ]]; then |
| 19 | echo "git pull" failed |
| 20 | exit |
| 21 | fi |
| 22 | |
Andy Bavier | 21f243a | 2015-04-24 13:19:47 -0400 | [diff] [blame] | 23 | docker build -t xos . |
| 24 | |
| 25 | docker stop $XOS |
| 26 | docker run -p 8000:8000 xos |