Browse Source

Refatora scripts bash

pull/2827/head
eribeiro 5 years ago
parent
commit
b3a42ff78c
  1. 2
      busy-wait.sh
  2. 2
      check_solr.sh
  3. 2
      docker-env.sh
  4. 2
      gunicorn_start.sh
  5. 2
      release.sh
  6. 2
      sapl/legacy/run_legacy_tests.sh
  7. 2
      sapl/legacy/scripts/migra_dbs.sh
  8. 2
      sapl/legacy/scripts/migra_um_db.sh
  9. 2
      sapl/legacy/scripts/recria_dbs_postgres.sh
  10. 2
      sapl/legacy/scripts/recria_um_db_postgres.sh
  11. 2
      sapl/legacy/scripts/shell_para_migracao.sh
  12. 2
      scripts/atualizar_producao.sh
  13. 2
      scripts/create_admin_user.sh
  14. 2
      scripts/django/check_migrations.sh
  15. 2
      scripts/django/check_qa.sh
  16. 2
      scripts/django/fix_qa.sh
  17. 2
      scripts/django/gerar_grafico_apps.sh
  18. 2
      scripts/django/reset_all_migrations.sh
  19. 2
      scripts/django/test_and_check_qa.sh
  20. 2
      scripts/hooks/instalar_hooks_git.sh
  21. 2
      scripts_docker/remove-all-containers.sh
  22. 2
      scripts_docker/remove-db.sh
  23. 3
      scripts_docker/restore-db.sh
  24. 2
      scripts_docker/shell_sapl.sh
  25. 2
      simple_gunicorn.sh
  26. 2
      start.sh

2
busy-wait.sh

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
while true; do
COUNT_PG=`psql $1 -c '\l \q' | grep sapl | wc -l`

2
check_solr.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Pass the base SOLR URL as parameter, i.e., bash check_solr http://localhost:8983

2
docker-env.sh

@ -1,4 +1,4 @@
#/bin/bash
#!/usr/bin/env bash
KEY=`python gen-key.py`
echo $KEY

2
gunicorn_start.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html

2
release.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
##
## Versioning info: [major].[minor].[patch][-RC[num]], example: 3.1.159, 3.1.159-RC1

2
sapl/legacy/run_legacy_tests.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# All tests under this directory are excluded in default pytest.ini
# To run them use this script in this directory

2
sapl/legacy/scripts/migra_dbs.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# rodar esse script na raiz do projeto

2
sapl/legacy/scripts/migra_um_db.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# rodar esse script na raiz do projeto
if [ $# -eq 1 ]; then

2
sapl/legacy/scripts/recria_dbs_postgres.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# (Re)cria todos os bancos postgres para migração
# cria um banco postgres (de mesmo nome) para cada banco mysql cujo nome começa com "sapl_"

2
sapl/legacy/scripts/recria_um_db_postgres.sh

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# (Re)cria um db postgres
# uso: recria_um_db_postgres <NOME DO BANCO>

2
sapl/legacy/scripts/shell_para_migracao.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Inicia um shell_plus com as configurações de migração usando um banco específico
# Uso: ./shell_para_migracao.sh <NOME DO BANCO>

2
scripts/atualizar_producao.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
git pull --rebase
workon sapl
pip install -r requirements/dev-requirements.txt

2
scripts/create_admin_user.sh

@ -1,2 +1,2 @@
#!/bin/bash
#!/usr/bin/env bash
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python manage.py shell --plain

2
scripts/django/check_migrations.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# a verificação de migrations pendentes deve passar

2
scripts/django/check_qa.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Verifica se um breakpoint foi esquecido no código
me=`basename "$0"`

2
scripts/django/fix_qa.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# QA fix: Use ese script para corrigir automaticamente vários
# problemas de estilo e boas práticas no código.

2
scripts/django/gerar_grafico_apps.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
git_project_root=$(git rev-parse --show-toplevel)
cd ${git_project_root}

2
scripts/django/reset_all_migrations.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Sends all django migrations to the trash bin
# Requires trash-cli. To install:

2
scripts/django/test_and_check_qa.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# QA checks: run this before every commit

2
scripts/hooks/instalar_hooks_git.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
ln -s -f `pwd`/scripts/hooks/pre-commit .git/hooks/pre-commit

2
scripts_docker/remove-all-containers.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
sudo docker stop $(docker ps -a -q) # Para containers
sudo docker rm $(sudo docker ps -a -q) # Remove containers
sudo docker rmi -f $( sudo docker images -q ) # Remove imagens

2
scripts_docker/remove-db.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
sudo docker stop sapl_localhost_1
sudo docker rm sapl_localhost_1
sudo docker rmi -f postgres

3
scripts_docker/restore-db.sh

@ -1,2 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
sudo pg_restore --disable-triggers --data-only sapl_30-03-16.tar | docker exec -i sapl_localhost_1 psql -U sapl

2
scripts_docker/shell_sapl.sh

@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
docker run --rm -ti sapl_web /bin/sh

2
simple_gunicorn.sh

@ -1,3 +1,5 @@
#!/usr/bin/env bash
DJANGODIR=/var/interlegis/sapl # Django project directory (*)
DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*)
DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*)

2
start.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
create_env() {
echo "[ENV FILE] creating .env file..."

Loading…
Cancel
Save