From 08ceb9bc315cae00e4ad22f001b083ae2d202d0e Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 26 Apr 2022 11:57:52 +0900 Subject: [PATCH 1/2] Remove unused shell script --- tools/azure.sh | 33 --------------------------------- tools/create-admin.sh | 10 ---------- tools/dev-celery.sh | 14 -------------- tools/dev-django.sh | 28 ---------------------------- tools/dev-nuxt.sh | 20 -------------------- tools/install-mssql.sh | 42 ------------------------------------------ 6 files changed, 147 deletions(-) delete mode 100755 tools/azure.sh delete mode 100755 tools/create-admin.sh delete mode 100755 tools/dev-celery.sh delete mode 100755 tools/dev-django.sh delete mode 100755 tools/dev-nuxt.sh delete mode 100755 tools/install-mssql.sh diff --git a/tools/azure.sh b/tools/azure.sh deleted file mode 100755 index b661b590..00000000 --- a/tools/azure.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -if [[ -z "${DOCCANO_LOCATION}" ]]; then echo "Missing DOCCANO_LOCATION environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_RESOURCE_GROUP}" ]]; then echo "Missing DOCCANO_LOCATION environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_APP_NAME}" ]]; then echo "Missing DOCCANO_APP_NAME environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_SECRET_KEY}" ]]; then echo "Missing DOCCANO_SECRET_KEY environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_ADMIN_USERNAME}" ]]; then echo "Missing DOCCANO_ADMIN_USERNAME environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_ADMIN_CONTACT_EMAIL}" ]]; then echo "Missing DOCCANO_ADMIN_CONTACT_EMAIL environment variable" >&2; exit 1; fi -if [[ -z "${DOCCANO_ADMIN_PASSWORD}" ]]; then echo "Missing DOCCANO_ADMIN_PASSWORD environment variable" >&2; exit 1; fi -if ! az account show >/dev/null; then echo "Must be logged into Azure" >&2; exit 2; fi - -set -o nounset - -az group create \ - --location "${DOCCANO_LOCATION}" \ - --name "${DOCCANO_RESOURCE_GROUP}" - -az group deployment create \ - --resource-group "${DOCCANO_RESOURCE_GROUP}" \ - --name "azuredeploy$1" \ - --parameters \ - appName="${DOCCANO_APP_NAME}" \ - secretKey="${DOCCANO_SECRET_KEY}" \ - adminUserName="${DOCCANO_ADMIN_USERNAME}" \ - adminContactEmail="${DOCCANO_ADMIN_CONTACT_EMAIL}" \ - adminPassword="${DOCCANO_ADMIN_PASSWORD}" \ - dockerImageName="${DOCKER_REGISTRY:-${DOCKER_USERNAME:-doccano}}/doccano:${1:-latest}" \ - dockerRegistry="${DOCKER_REGISTRY}" \ - dockerRegistryUserName="${DOCKER_USERNAME}" \ - dockerRegistryPassword="${DOCKER_PASSWORD}" \ - --template-file azuredeploy.json diff --git a/tools/create-admin.sh b/tools/create-admin.sh deleted file mode 100755 index 72d76622..00000000 --- a/tools/create-admin.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset - -if [[ "$#" -ne 3 ]]; then echo "Usage: $0 " >&2; exit 1; fi - -python app/manage.py wait_for_db -python app/manage.py migrate -python app/manage.py create_admin --noinput --username="$1" --email="$2" --password="$3" diff --git a/tools/dev-celery.sh b/tools/dev-celery.sh deleted file mode 100755 index 0c60a90c..00000000 --- a/tools/dev-celery.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset - -cd "/src/backend" - -( - echo "Waiting for database" - python manage.py wait_for_db - - echo "Starting celery" - "watchmedo" auto-restart --directory="." --pattern="*.py" --recursive -- "celery" --app=config worker --loglevel=info --pool=solo -) diff --git a/tools/dev-django.sh b/tools/dev-django.sh deleted file mode 100755 index bbb5b9ea..00000000 --- a/tools/dev-django.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -if [[ -z "${ADMIN_USERNAME}" ]]; then echo "Missing ADMIN_USERNAME environment variable" >&2; exit 1; fi -if [[ -z "${ADMIN_PASSWORD}" ]]; then echo "Missing ADMIN_PASSWORD environment variable" >&2; exit 1; fi -if [[ -z "${ADMIN_EMAIL}" ]]; then echo "Missing ADMIN_EMAIL environment variable" >&2; exit 1; fi - -set -o nounset - -app="/src/backend" - -echo "Initializing database" -python "${app}/manage.py" wait_for_db -python "${app}/manage.py" migrate -python "${app}/manage.py" create_roles - -if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMIN_EMAIL}" ]]; then - python "${app}/manage.py" create_admin \ - --username "${ADMIN_USERNAME}" \ - --password "${ADMIN_PASSWORD}" \ - --email "${ADMIN_EMAIL}" \ - --noinput \ - || true -fi - -echo "Starting django" -python -u "${app}/manage.py" runserver ${HOST:-0.0.0.0}:${PORT:-8000} diff --git a/tools/dev-nuxt.sh b/tools/dev-nuxt.sh deleted file mode 100755 index 36c38d62..00000000 --- a/tools/dev-nuxt.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset - -root="$(dirname "$0")/.." -app="${root}/frontend" - -( - cd "${app}" - - if [[ ! -d node_modules/.bin ]]; then - echo "Installing dependencies" - yarn install - fi - - echo "Starting frontend server" - yarn lintfix - yarn dev -) diff --git a/tools/install-mssql.sh b/tools/install-mssql.sh deleted file mode 100755 index c7b9d794..00000000 --- a/tools/install-mssql.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset - -# parse arguments -mode="prod" -for opt in "$@"; do - case "${opt}" in - --dev) mode="dev" ;; - esac -done - -set -eo pipefail - -# install build dependencies -apt-get update -apt-get install --no-install-recommends -y --allow-downgrades \ - curl \ - gnupg=2.1.18-8~deb9u4 \ - apt-transport-https - -# install dependency to compile django-pyodbc-azure -if [[ "${mode}" = "dev" ]]; then - apt-get install --no-install-recommends -y \ - unixodbc-dev=2.3.4-1 -fi - -# add mssql repo -curl -fsS https://packages.microsoft.com/keys/microsoft.asc | apt-key add - -curl -fsS https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql.list -apt-get update - -# install mssql -ACCEPT_EULA=Y apt-get install --no-install-recommends -y \ - msodbcsql17=17.3.1.1-1 \ - mssql-tools=17.3.0.1-1 - -# remove build dependencies and artifacts -apt-get remove -y \ - curl gnupg apt-transport-https -rm -rf /var/lib/apt/lists/* From 1c9bbd7edf74e08b449cf0a71d9dc3c795e3688e Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 26 Apr 2022 12:01:17 +0900 Subject: [PATCH 2/2] Remove unused component: ChartDoughnut.vue --- frontend/components/metrics/ChartDoughnut.vue | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 frontend/components/metrics/ChartDoughnut.vue diff --git a/frontend/components/metrics/ChartDoughnut.vue b/frontend/components/metrics/ChartDoughnut.vue deleted file mode 100644 index a93c0ef5..00000000 --- a/frontend/components/metrics/ChartDoughnut.vue +++ /dev/null @@ -1,28 +0,0 @@ -