From: Guillaume Pellerin Date: Wed, 14 Mar 2018 09:59:10 +0000 (+0100) Subject: reorganize scripts X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f3cec2b13278c1dadf26ac33c99d0614479db0a5;p=docker-django-scripts.git reorganize scripts --- diff --git a/docker-clean.sh b/docker-clean.sh deleted file mode 100644 index 5b60d8b..0000000 --- a/docker-clean.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Delete all stopped containers (including data-only containers) -docker rm $(docker ps -a -q) -# Delete all 'untagged/dangling' () images -docker rmi $(docker images -q -f dangling=true) diff --git a/docker-staging.sh b/docker-staging.sh deleted file mode 100755 index d5d8b75..0000000 --- a/docker-staging.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -docker-compose -f docker-compose.yml -f env/staging.yml up diff --git a/docker/clean.sh b/docker/clean.sh new file mode 100755 index 0000000..5b60d8b --- /dev/null +++ b/docker/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Delete all stopped containers (including data-only containers) +docker rm $(docker ps -a -q) +# Delete all 'untagged/dangling' () images +docker rmi $(docker images -q -f dangling=true) diff --git a/gulp.sh b/gulp.sh deleted file mode 100755 index dcff3d0..0000000 --- a/gulp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -docker-compose run app python /srv/app/manage.py gulp diff --git a/misc/gulp.sh b/misc/gulp.sh new file mode 100755 index 0000000..dcff3d0 --- /dev/null +++ b/misc/gulp.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker-compose run app python /srv/app/manage.py gulp diff --git a/pull.sh b/pull.sh deleted file mode 100755 index 9abe193..0000000 --- a/pull.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# We need to chown folders as they are docker's volumes -sudo chown -R $USER var/media -sudo chown -R $USER var/backup - -# Update main project -git pull - -# Update submodules -./bin/update_submodules.sh - -# Restore database -if [ "$1" = "--restore-db" ]; - then - docker-compose run db /srv/bin/db/restore.sh -fi - -# We need to chown folders as they are docker's volumes -# (do not work on OSX, hence the test) -if ! uname -a | grep Darwin > /dev/null; then - sudo chown -R www-data var/media - sudo chown -R root var/backup -fi diff --git a/staging/up.sh b/staging/up.sh new file mode 100755 index 0000000..d5d8b75 --- /dev/null +++ b/staging/up.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker-compose -f docker-compose.yml -f env/staging.yml up diff --git a/upgrade.sh b/upgrade.sh deleted file mode 100755 index 89df740..0000000 --- a/upgrade.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# Update main project -git pull - -# Update submodules -./bin/update_submodules.sh - -# Apply migrations -if [ "$1" = "--migrate" ]; - then - docker-compose run app python /srv/app/manage.py migrate -fi - -# Build front-end -./bin/build_front.sh - -# Build documentation -docker-compose run app bash /srv/doc/build.sh - -# Reload Wsgi -if [ "$1" = "-r" ]; - then - touch app/wsgi.py -fi - -# Install local cron to -if [ "$1" = "--cron" ]; - then - sudo cp ./etc/cron.d/* /etc/cron.d/ -fi