Commit Graph

15 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
d7bc82a8ab Allow to change the application name for deployments
When someone installs CONSUL with the installer using
a custom `app_name`, the deployment configuration file
must use the same application name; otherwise, the
Capistrano task to update the crontab will duplicate the
crontab entries with different names causing unexpected
errors.

Below is an example of the issue. The first set of crontab
entries was created during installation using a custom
app_name. The second set of entries are duplicated
during the first deployment with a wrong application
name in the config/deploy.rb file.

```
deploy@ubuntu:~$ crontab -l
* * * * * /bin/bash -l -c 'date > ~/cron-test.txt'
0 5 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && RAILS_ENV=production bundle exec rake -s sitemap:refresh --silent'
0 1 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && RAILS_ENV=production bundle exec rake files:remove_old_cached_attachments --silent'
0 3 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && RAILS_ENV=production bundle exec rake votes:reset_hot_score --silent'
0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && RAILS_ENV=production bundle exec rake -s stats:generate --silent'
@reboot /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && bundle exec puma -C config/puma/production.rb'
@reboot /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230529101753 && RAILS_ENV=production bin/delayed_job -n 2 restart'

* * * * * /bin/bash -l -c 'date > ~/cron-test.txt'
0 5 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230530112702 && RAILS_ENV=production bundle exec rake -s sitemap:refresh --silent'
0 1 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230530112702 && RAILS_ENV=production bundle exec rake files:remove_old_cached_attachments --silent'
0 3 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230530112702 && RAILS_ENV=production bundle exec rake votes:reset_hot_score --silent'
0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230530112702 && RAILS_ENV=production bundle exec rake -s stats:generate --silent'
@reboot /bin/bash -l -c 'cd /home/deploy/participacyl/releases/20230530112702 && bundle exec puma -C config/puma/production.rb'
```
2023-06-07 16:58:40 +02:00
Javi Martín
bbf6a31a05 Simplify deploy secrets example configuration file
So now it's similar to our database example file.
2023-03-21 19:15:25 +01:00
Javi Martín
8aa113a47c Unify deploy secret keys for the main server
We were using `server` on staging but `server1` and `server2` on
preproduction and production.

The reason behind it is we've always used one server on staging but
sometimes we've used several servers on preproduction and production.

However, this is a bit of a mess on installations which have only one
server on preproduction or production and need to use the `server` key
for the staging environments but `server1` for other environments.

So, in order to keep compatibility with existing Consul installations,
we're now allowing either `server` or `server1` on any environment.
2023-03-21 19:01:28 +01:00
Javi Martín
b115b0cc8d Use only one server when deploying to preproduction
It doesn't make much sense that by default we use one server on
production on two servers on preproduction.

Note we're keeping `server1` instead of using just `server` in order to
keep compatibility with existing installation.
2023-03-21 18:53:18 +01:00
taitus
6543009942 Add consistency between deploy-secrets and installer
The installer creates the application in the following path:
home_dir: "/home/{{{ deploy_user }}"

We update the variable "deploy_to" in the deploy-secrets
file to be consistent with the installer.

While we are modifying the file we also update the "user"
variable in staging and preproduction sections with the
installer default value: "deploy_user: deploy" the same as
we already have in the production section.
2021-11-05 12:39:47 +01:00
Javi Martín
28b282df12 Remove unused deployment configuration variables
The server_name variable isn't used since we removed the Apache task in
commit 012d5297e, db_server and config_files aren't used since we
removed the capistrano templates in that same commit, and full_app_name
isn't used since commit 94a7e13dc.
2020-11-04 16:52:43 +01:00
voodoorai2000
40b9d658d7 Bring back deploy-secrets.yml.example
It was accidentally removed in this PR[1] and it is necessary to help in the capistrano configuration.

[1] https://github.com/consul/consul/pull/3412/files#diff-e2e7e59de6b2b5c76f396a862c48ccc5L1
2019-05-21 13:46:48 +02:00
decabeza
4db54092e6 Removes unrelated dashboard changes 2018-10-18 01:26:07 +02:00
Juan Salvador Pérez García
1db5a00eae Prepare capistrano/db migrations to support more setups (#2)
The following parameters have been added to deploy-secrets.yml:

* **use_rvm**: yes/no
* **ruby_version**: Ruby version for rvm. Defaults to 2.3.2
* **repository**: Git repository. Defaults to the oficial repository
* **branch**: Branch to deploy. Defaults to master
* **rails_env**: Defaults to the stage.

Fixed migrations that required admin rights. Now first check if the postgress extensions are available. If so finish without doing nothin.

Added support for passenger.
2018-07-17 17:46:54 +02:00
Bertocq
9260561332 Update deploy secrets example file 2017-10-02 17:55:59 +02:00
Alberto Garcia Cabeza
42722080fc Changes references to Madrid 2016-07-05 13:47:14 +02:00
Juanjo Bazán
b946f31fc7 changes 'participacion' to 'consul' in config 2015-11-23 14:10:46 +01:00
Juanjo Bazán
385da5185a adds keys to deploy-secrets.yml 2015-08-21 17:14:00 +02:00
Manuel Maldonado
4b501ee46b Capistrano recipe 2015-08-12 01:36:42 +02:00
Juanjo Bazán
949f8a68df adds sample deploy-secrets.yml file 2015-08-07 12:19:01 +02:00