ZeusWPI / Gandalf

You Shall Not Pass - An advanced e-ticket system for student clubs -
http://event.fkgent.be
MIT License
10 stars 7 forks source link

Capistrano docker #583

Closed TomNaessens closed 2 years ago

TomNaessens commented 2 years ago

Updates #582

⚠️ When testing this, do not run bundle exec cap production deploy as the branch is still set to master, and not to this one. If you want to test it first before approving, change set :branch, 'master' to set :branch, 'capistrano-docker'.

Draft PR for docker support, uses https://github.com/TomNaessens/capistrano-docker as capistrano goodies.

When you want to deploy, just run bundle exec cap production deploy locally, it will do everything:

Useful commands:

I'm still playing around with these and with the name, for a full list, execute bundle exec cap --tasks.

For the docker:compose:* tasks, the service defaults to web. In short, it's trying to find to find a container with :docker_compose_project_name.*:service as regex. :docker_compose_project_name is set in the deploy.rb file, the service can be overwritten using default Rake syntax: bundle exec cap production 'docker:compose:logs:tail[db]'. I'm sorry for the syntax, but it is what it is.