$ mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 43 Server version: 10.1.0-MariaDB-1~trusty-log mariadb.org binary distribution
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
> GRANT ALL PRIVILEGES ON *.* TO 'tsuru'@'%' IDENTIFIED BY 'password' with GRANT OPTION; Query OK, 0 rows affected (0.00 sec) > FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
$ tsuru app-create mysql-api python App "mysql-api" is being created! Use app-info to check the status of the app and its units. Your repository for"mysql-api" project is "git@10.1.1.17:mysql-api.git"
git pushしてmysqlapiアプリをtsuruにデプロイします。
$ cd ~/mysqlapi $ tsuru app-info -a mysql-api|grep Repository Repository: git@10.1.1.17:mysql-api.git $ git push git@10.1.1.17:mysql-api.git master ... remote: Successfully installed Django MySQL-python boto crane-ec2 gunicorn gevent greenlet remote: Cleaning up... remote: remote: ---- Starting 1 unit ---- remote: ---> Started unit 1/1... remote: remote: ---> App will be restarted, please check its logs for more details... remote: remote: remote: OK To git@10.1.1.17:mysql-api.git * [new branch] master -> master
環境変数の設定
手順に環境変数の設定方法があるのですが、まだどのように動作するのかよくわかっていません。
$ tsuru env-set -a mysql-api DJANGO_SETTINGS_MODULE=mysqlapi.settings $ tsuru env-set -a mysql-api MYSQLAPI_DB_NAME=mysqlapi $ tsuru env-set -a mysql-api MYSQLAPI_DB_USER=tsuru $ tsuru env-set -a mysql-api MYSQLAPI_DB_PASSWORD=password $ tsuru env-set -a mysql-api MYSQLAPI_DB_HOST=10.1.1.17