blob: 09c639ddf3673a9bca3c737c341b8055fb99cfbc [file] [log] [blame]
Scott Baker55471312015-05-12 11:15:10 -07001#!/bin/bash
Andy Bavier21f243a2015-04-24 13:19:47 -04002
3TMPDIR="/tmp/initdata"
4XOSDIR="/home/ubuntu/xos"
5
6mkdir -p $TMPDIR
7rm -f $TMPDIR/*.json
8
9XOS=$( docker ps|grep "xos:latest"|awk '{print $NF}' )
10docker exec $XOS /opt/xos/scripts/opencloud dumpdata
11docker cp $XOS:/opt/xos_backups/dumpdata-latest.json $TMPDIR
Scott Baker55471312015-05-12 11:15:10 -070012docker cp $XOS:/opt/xos/xos_config $TMPDIR
Andy Bavier21f243a2015-04-24 13:19:47 -040013cp $TMPDIR/*.json $XOSDIR/xos/core/fixtures/initial_data.json
Scott Baker55471312015-05-12 11:15:10 -070014cp $TMPDIR/xos_config $XOSDIR/xos/
Andy Bavier21f243a2015-04-24 13:19:47 -040015
16git pull
Scott Baker55471312015-05-12 11:15:10 -070017
18if [[ $? != 0 ]]; then
19 echo "git pull" failed
20 exit
21fi
22
Andy Bavier21f243a2015-04-24 13:19:47 -040023docker build -t xos .
24
25docker stop $XOS
26docker run -p 8000:8000 xos