From 67a7f77599c906d5694002e534ac4f7b8ceead59 Mon Sep 17 00:00:00 2001 From: william mantly Date: Fri, 30 Sep 2016 18:57:12 -0400 Subject: [PATCH] stuff --- create.sh | 12 +++++++++--- update.sh | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/create.sh b/create.sh index 09b1dc8..aa59159 100644 --- a/create.sh +++ b/create.sh @@ -7,6 +7,7 @@ nodePort=`./random_port.py` eval "$(ssh-agent -s)" ssh-add /root/.ssh/id_github_rsa + mkdir /var/www/gitwrapper/$name cd /var/www/gitwrapper/$name chmod 777 . @@ -16,6 +17,10 @@ DJANGO_SETTINGS_MODULE=project.settings.prod export DJANGO_SETTINGS_MODULE=project.settings.prod git clone $sshURL . +git checkout prod + +# change https urls to ssh +perl -pi -e 's/https:\/\/github.com\//ssh:\/\/git@github.com:/g' .gitmodules ./scripts/setup.sh @@ -23,16 +28,17 @@ cp /var/www/local_settings.py project/settings/local_settings.py echo "BRANCH = '$name'" >> project/settings/local_settings.py # set up project from prod, load database -git checkout prod + ./manage.py createcachetable ./manage.py migrate ./manage.py loaddata /var/www/django.json git checkout $name - +# change https urls to ssh +perl -pi -e 's/https:\/\/github.com\//ssh:\/\/git@github.com:/g' .gitmodules ./scripts/setup.sh - +git stash # python3 manage.py collectstatic --noinput ./manage.py migrate chmod 777 db.sqlite3 diff --git a/update.sh b/update.sh index d88d916..b224ce1 100644 --- a/update.sh +++ b/update.sh @@ -13,7 +13,11 @@ cd /var/www/gitwrapper/$name git stash git pull --force origin $name +perl -pi -e 's/https:\/\/github.com\//ssh:\/\/git@github.com:/g' .gitmodules +git submodule sync + ./scripts/setup.sh +git stash python3 manage.py collectstatic --noinput python3 manage.py migrate