Skip to content

Add next.timeoverflow.org Capistrano deploy #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2019

Conversation

sauloperez
Copy link
Collaborator

This is the upgraded server we are setting up to host the app. Time to deploy and start testing! 🎉

sauloperez added a commit to coopdevs/timeoverflow-provisioning that referenced this pull request Nov 20, 2019
This is needed for coopdevs/timeoverflow#525 to
work. Otherwise, Rails can't find the appropriate entry in
`config/database.yml`. It also provides a different Rails secret for
`next.
This is the upgraded server we are setting up to host the app. Time to
deploy and start testing! 🎉

The Capistrano environment is tightly coupled with Rails environments so
we need to add a new one called `next`.
This needed when deploying to a server for the first time or when you
want to wipe out a database.

The issue I'm fixing is this. Things have evolved and in
https://github.com/coopdevs/timeoverflow-provisioning we no longer set
things up to enable PostgreSQL extensions such as `pg_trgm`. Because
Capistrano runs `db:migrate` when deploying very old migrations
like `db/migrate/00000000000002_setup_pg_trgm.rb` don't work anymore.

I prefer to make this step explicit in the code and with some context
rather than having to do this manually in the server and let the dev in
charge figure it out every time.

Apparently, from capistrano/rails#118 I see
this is a known issue for which there's no provided solution. I copied
a solution proposed by a capistrano/rails member so should be good.

Just run it as follows:

```
$ bundle exec cap staging deploy COLD=1
```
@sauloperez
Copy link
Collaborator Author

sauloperez commented Dec 4, 2019

All of a sudden the PostgreSQL 9.4 setup in Travis CI is broken 🤦‍♂️ Develop was green a month ago in #523 and now, restarting that same build makes the 9.4 service fail:

$ travis_setup_postgresql 9.4
Starting PostgreSQL v9.4
Job for [email protected] failed because the service did not take the steps required by its unit configuration.
See "systemctl status [email protected]" and "journalctl -xe" for details.
sudo systemctl start [email protected]

It simply times out and then the rake task can't find any database running.

We assume the risk and merge this as it's needed to migrate the production server, which we're going to do today. We'll work on fixing the build before the actual migration.

@sauloperez sauloperez merged commit 5333ba4 into develop Dec 4, 2019
@sauloperez sauloperez deleted the add-next-environment branch December 4, 2019 09:12
sauloperez added a commit that referenced this pull request Dec 4, 2019
It comes installed in Travis CI boxes. This might fix the service start,
which is currently timing out. See details:
#525 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant