diff --git a/cleanup_pyc.sh b/cleanup_pyc.sh deleted file mode 100644 index 8d210e0425c..00000000000 --- a/cleanup_pyc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -find . -name "*.pyc" -exec rm -f {} \; diff --git a/flake8.sh b/flake8.sh new file mode 100644 index 00000000000..5b7fab077c1 --- /dev/null +++ b/flake8.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +flake8 geonode diff --git a/scripts/misc/align_remote_branches.sh b/scripts/misc/align_remote_branches.sh new file mode 100644 index 00000000000..93b5a570569 --- /dev/null +++ b/scripts/misc/align_remote_branches.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This is the script directory +# pushd $(dirname $0) + +# This is the current directory +pushd $PWD + +git fetch --all --prune +OUTPUT=`git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv) | awk '{print $1}' | xargs git branch -D 2>&1` + +`echo $OUTPUT | grep 'branch name required' &> /dev/null` +if [ $? == 0 ]; then + echo "All remote branches are aligned!" + BRANCH=`git branch 2>&1` + echo "You are currently on branch: $BRANCH" +fi diff --git a/scripts/misc/cleanup_pyc.sh b/scripts/misc/cleanup_pyc.sh new file mode 100644 index 00000000000..4eeae2b9440 --- /dev/null +++ b/scripts/misc/cleanup_pyc.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# This is the script directory +# pushd $(dirname $0) + +# This is the current directory +pushd $PWD + +find . -name "*.pyc" -exec rm -f {} \; diff --git a/scripts/misc/django_backup.sh b/scripts/misc/django_backup.sh new file mode 100644 index 00000000000..658cbe1c9d8 --- /dev/null +++ b/scripts/misc/django_backup.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +source ~/.virtualenvs/geonode/bin/activate + +# This is the script directory +# pushd $(dirname $0) + +# This is the current directory +pushd $PWD + +case $1 in + "backup-dir") + case $2 in + "") + echo "Missing 'backup-dir ' path!" + ;; + *) + echo "Starting Backup to $2" + DJANGO_SETTINGS_MODULE=geonode.settings python -W ignore manage.py backup --backup-dir=$2 + ;; + esac + ;; + *) + echo "Missing 'backup-dir' parameter!" + ;; +esac + +exit 0 diff --git a/scripts/misc/django_generate_secret_key.sh b/scripts/misc/django_generate_secret_key.sh new file mode 100644 index 00000000000..7019cf49464 --- /dev/null +++ b/scripts/misc/django_generate_secret_key.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# This is the script directory +# pushd $(dirname $0) + +# This is the current directory +pushd $PWD + +OUTPUT=`python -c "import random,string;print(''.join([random.SystemRandom().choice(\"{}{}{}\".format(string.ascii_letters, string.digits, \"---\")) for i in range(63)]).replace('\\'','\\'\"\\'\"\\''))"; 2>&1` + +echo $OUTPUT diff --git a/scripts/misc/django_restore.sh b/scripts/misc/django_restore.sh new file mode 100644 index 00000000000..78b4c9e98a9 --- /dev/null +++ b/scripts/misc/django_restore.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +source ~/.virtualenvs/geonode/bin/activate + +# This is the script directory +# pushd $(dirname $0) + +# This is the current directory +pushd $PWD + +case $1 in + "backup-file") + case $2 in + "") + echo "Missing 'backup-file ' path!" + ;; + *) + echo "Starting Restore from $2" + DJANGO_SETTINGS_MODULE=geonode.settings python -W ignore manage.py restore --backup-file=$2 + # e.g.: source-address=localhost:8000 target-address=example.com + DJANGO_SETTINGS_MODULE=geonode.settings python -W ignore manage.py migrate_baseurl -f --source-address=source-address --target-address=target-address + ;; + esac + ;; + *) + echo "Missing 'backup-file' parameter!" + ;; +esac + +exit 0