disco init root@123.123.123.123
disco projects:add \
--name postgres \
--github-repo https://github.com/letsdiscodev/disco-addon-postgres \
--deploy
disco projects:add \
--name first-project \
--github-repo git@github.com:exampleuser/examplerepo.git \
--domain app.example.com
Follow the instructions from the output above for the deployment key and webhook.
disco command postgres db:add --project first-project
This should have set the env variable DATABASE_URL
for first-project
.
Also notice that there's the postgres
addon and the Postgres database with a generated name like postgres-db-clean-passenger
:
disco projects:list
The addon deployed Postgres and added a database for first-project
.
Adding more databases for other projects should use the same Postgres instance.
pgcli $(disco env:get DATABASE_URL --project first-project)
-- in pgcli
CREATE TABLE page_views (id SERIAL, count INTEGER);
Either push a commit to the project to let the webhook trigger a build, or use the CLI:
disco deploy --project first-project
disco run --project first-project "python migrate.py"
disco logs --project first-project
disco syslog:add syslog+tls://logsN.papertrailapp.com:12345
disco deploy:list --project first-project
disco deploy:output --project first-project --deployment 123
Install the package locally in a virtualenv.
$ python3 -m venv .venv
$ . .venv/bin/activate
$ pip install --editable .
Test that it works
$ disco --version
disco-cli 0.1.0