Browse Source

Remove unused shell scripts

pull/1147/head
Hironsan 3 years ago
parent
commit
49087a69fe
4 changed files with 0 additions and 83 deletions
  1. 20
      tools/cd.sh
  2. 10
      tools/ci.sh
  3. 35
      tools/dev-django.sh
  4. 18
      tools/dev-webpack.sh

20
tools/cd.sh

@ -1,20 +0,0 @@
#!/usr/bin/env bash
if [[ -z "${DOCKER_USERNAME}" ]]; then echo "Missing DOCKER_USERNAME environment variable" >&2; exit 1; fi
if [[ -z "${DOCKER_PASSWORD}" ]]; then echo "Missing DOCKER_PASSWORD environment variable" >&2; exit 1; fi
if [[ -z "$1" ]]; then echo "Usage: $0 <tag>" >&2; exit 1; fi
set -o errexit
if [[ -z "${DOCKER_REGISTRY}" ]]; then
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
else
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}"
DOCKER_USERNAME="${DOCKER_REGISTRY}"
fi
docker build -t "${DOCKER_USERNAME}/doccano:latest" .
docker build -t "${DOCKER_USERNAME}/doccano:$1" .
docker push "${DOCKER_USERNAME}/doccano:latest"
docker push "${DOCKER_USERNAME}/doccano:$1"

10
tools/ci.sh

@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -o errexit
flake8
python app/manage.py migrate
coverage run --source=app app/manage.py test server.tests api.tests authentification.tests
coverage report
(cd app/server/static && npm run lint)

35
tools/dev-django.sh

@ -1,35 +0,0 @@
#!/usr/bin/env bash
set -o errexit
root="$(dirname "$0")/.."
app="${root}/app"
venv="${root}/venv"
if [[ ! -f "${venv}/bin/python" ]]; then
echo "Creating virtualenv"
mkdir -p "${venv}"
python3 -m venv "${venv}"
"${venv}/bin/pip" install --upgrade --no-cache-dir pip setuptools
fi
echo "Installing dependencies"
apt-get update && apt-get install -y g++ unixodbc-dev # pyodbc build dependencies
"${venv}/bin/pip" install --no-cache-dir -r "${app}/requirements.txt"
echo "Initializing database"
"${venv}/bin/python" "${app}/manage.py" wait_for_db
"${venv}/bin/python" "${app}/manage.py" migrate
"${venv}/bin/python" "${app}/manage.py" create_roles
if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMIN_EMAIL}" ]]; then
"${venv}/bin/python" "${app}/manage.py" create_admin \
--username "${ADMIN_USERNAME}" \
--password "${ADMIN_PASSWORD}" \
--email "${ADMIN_EMAIL}" \
--noinput \
|| true
fi
echo "Starting django"
"${venv}/bin/python" -u "${app}/manage.py" runserver "$@"

18
tools/dev-webpack.sh

@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -o errexit
root="$(dirname "$0")/.."
frontend="${root}/app/server/static"
(
cd "${frontend}"
if [[ ! -d node_modules/.bin ]]; then
echo "Installing dependencies"
npm install
fi
echo "Starting webpack"
npm start
)
Loading…
Cancel
Save