Developer setup update
This commit is contained in:
parent
e7bbbfac84
commit
43e9e6843d
3 changed files with 22 additions and 10 deletions
|
|
@ -53,9 +53,6 @@ export $(grep -v '^#' .env | xargs -0)
|
|||
# Hint: there is a known issue with uwsgi. It's not used in the local dev environment. Feel free to comment it in `engine/requirements.txt`.
|
||||
cd engine && pip install -r requirements.txt
|
||||
|
||||
# Create folder for database
|
||||
mkdir sqlite_data
|
||||
|
||||
# Migrate the DB:
|
||||
python manage.py migrate
|
||||
|
||||
|
|
@ -107,7 +104,7 @@ python manage.py issue_invite_for_the_frontend --override
|
|||
OnCall API URL:
|
||||
http://host.docker.internal:8000
|
||||
|
||||
OnCall Invitation Token (Single use token to connect Grafana instance):
|
||||
Invitation Token (Single use token to connect Grafana instance):
|
||||
Response from the invite generator command (check above)
|
||||
|
||||
Grafana URL (URL OnCall will use to talk to Grafana instance):
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ services:
|
|||
ports:
|
||||
- 3306:3306
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: local_dev_pwd
|
||||
MYSQL_ROOT_PASSWORD: empty
|
||||
MYSQL_DATABASE: oncall_local_dev
|
||||
healthcheck:
|
||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||
|
|
@ -42,7 +42,7 @@ services:
|
|||
mysql-to-create-grafana-db:
|
||||
image: mariadb:10.2
|
||||
platform: linux/x86_64
|
||||
command: bash -c "mysql -h mysql -uroot -plocal_dev_pwd -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
|
||||
command: bash -c "mysql -h mysql -uroot -pempty -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
|
|
@ -56,7 +56,7 @@ services:
|
|||
GF_DATABASE_TYPE: mysql
|
||||
GF_DATABASE_HOST: mysql
|
||||
GF_DATABASE_USER: root
|
||||
GF_DATABASE_PASSWORD: local_dev_pwd
|
||||
GF_DATABASE_PASSWORD: empty
|
||||
GF_SECURITY_ADMIN_USER: oncall
|
||||
GF_SECURITY_ADMIN_PASSWORD: oncall
|
||||
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: grafana-oncall-app
|
||||
|
|
|
|||
|
|
@ -10,14 +10,29 @@ MIRAGE_SECRET_KEY = os.environ.get(
|
|||
)
|
||||
MIRAGE_CIPHER_IV = os.environ.get("MIRAGE_CIPHER_IV", "tZZa+60zTZO2NRcS")
|
||||
|
||||
# Primary database must have the name "default"
|
||||
# Workaround to use pymysql instead of mysqlclient
|
||||
import pymysql
|
||||
|
||||
pymysql.install_as_MySQLdb()
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.sqlite3",
|
||||
"NAME": os.path.join(BASE_DIR, "sqlite_data/db.sqlite3"), # noqa
|
||||
"ENGINE": "django.db.backends.mysql",
|
||||
"NAME": os.environ.get("MYSQL_DB_NAME", "oncall_local_dev"),
|
||||
"USER": os.environ.get("MYSQL_USER", "root"),
|
||||
"PASSWORD": os.environ.get("MYSQL_PASSWORD"),
|
||||
"HOST": os.environ.get("MYSQL_HOST", "127.0.0.1"),
|
||||
"PORT": os.environ.get("MYSQL_PORT", "3306"),
|
||||
"OPTIONS": {
|
||||
"charset": "utf8mb4",
|
||||
"connect_timeout": 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
os.environ.setdefault("OSS", "True")
|
||||
INSTALLED_APPS += ["apps.oss_installation"] # noqa
|
||||
|
||||
TESTING = "pytest" in sys.modules or "unittest" in sys.modules
|
||||
|
||||
READONLY_DATABASES = {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue