Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A bunch of .sh scripts misc utilities
- Loading branch information
afabiani
committed
Mar 15, 2018
1 parent
f565571
commit 26ce544
Showing
7 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
flake8 geonode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <backup-dis>' 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <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 |