Skip to content

project-yori/yori-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yori-server

Local Development

Prerequisite

Run Development Server

  • Create environment (This is only needed for the first time)

    python3 -m venv venv
  • Activate environment

    . venv/bin/activate
  • Install Flask and other dependencies locally (if you haven't)

    pip install -r requirements.txt
  • Install and launch Cloud SQL Proxy

    ./cloud_sql_proxy -dir=/tmp/cloudsql -instances=yori_instance_name=tcp:3306
  • Launch server

    env FLASK_APP=main.py DB_USER=username DB_PASS=password DB_NAME=database CLOUD_SQL_CONNECTION_NAME=yori_instance_name flask run

    or if you want to enable network access to local server (especially when you are developing yori-view)

    env FLASK_APP=main.py DB_USER=username DB_PASS=password DB_NAME=database CLOUD_SQL_CONNECTION_NAME=yori_instance_name flask run --host=0.0.0.0

    If setting environments bothers you, write them in your dotfiles.

Deploy

Before deploy to gcloud, you have to install gcloud sdk. (Install guide)

  • Create a secret.yaml (if you haven't) and set your own environment variable NOTICE: do not upload your secret.yaml to repository

    env_variables:
      CLOUD_SQL_CONNECTION_NAME: your-connection-name
      DB_USER: your-account
      DB_PASS: your-password
      DB_NAME: your-database
      SLACK_WEBHOOK_URL: slack-webhook-url
  • Deploy Command

    gcloud app deploy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages