Staging instance, all changes can be removed at any time

Skip to content

Deploy refresh save code now status cron

This installs the cron to run every minute only on one webapp instance per environment (each environment instance share the same db so no need to trigger the update on both).

Test Plan

vagrant happy:

vagrant@webapp:~$ cat /etc/cron.d/puppet-refresh-savecodenow-statuses
# Managed by puppet (module profile::cron), manual changes will be lost

# Cron snippet refresh-savecodenow-statuses
* * * * * root chronic sh -c "/usr/bin/django-admin refresh_savecodenow_statuses"

octocatalog-diff moma (install cron), webapp1 (noop), webapp.staging (install cron)

$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging webapp.internal.staging.swh.network

Found host webapp.internal.staging.swh.network
WARN     -> Environment "wip-pg-hba-rules-in-yaml" contained non-word characters, correcting name to wip_pg_hba_rules_in_yaml
Cloning into '/tmp/swh-ocd.ZJOXp0KT/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.ZJOXp0KT/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host webapp.internal.staging.swh.network
I, [2021-04-26T18:39:09.111782 #19595]  INFO -- : Catalogs compiled for webapp.internal.staging.swh.network
I, [2021-04-26T18:39:11.454821 #19595]  INFO -- : Diffs computed for webapp.internal.staging.swh.network
diff origin/production/webapp.internal.staging.swh.network current/webapp.internal.staging.swh.network
*******************************************
+ Concat_fragment[profile::cron::refresh-savecodenow-statuses] =>
   parameters =>
      "order": "10"
      "tag": "profile::cron::logrotate-journal"
      "target": "profile::cron::logrotate-journal"
      "content": >>>
# Cron snippet refresh-savecodenow-statuses
* * * * * root chronic sh -c "/usr/bin/django-admin refresh_savecodenow_statuses"
<<<
*******************************************
+ Profile::Cron::D[refresh-savecodenow-statuses] =>
   parameters =>
      "command": "chronic sh -c \"/usr/bin/django-admin refresh_savecodenow_statuses\""
      "hour": "*"
      "minute": "*"
      "target": "logrotate-journal"
      "unique_tag": "refresh-savecodenow-statuses"
      "user": "root"
*******************************************
*** End octocatalog-diff on webapp.internal.staging.swh.network
$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging webapp1

Found host webapp1.internal.softwareheritage.org
WARN     -> Environment "wip-pg-hba-rules-in-yaml" contained non-word characters, correcting name to wip_pg_hba_rules_in_yaml
Cloning into '/tmp/swh-ocd.qH6726CQ/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.qH6726CQ/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host webapp1.internal.softwareheritage.org
I, [2021-04-26T18:40:09.360554 #1224]  INFO -- : Catalogs compiled for webapp1.internal.softwareheritage.org
I, [2021-04-26T18:40:11.386659 #1224]  INFO -- : Diffs computed for webapp1.internal.softwareheritage.org
I, [2021-04-26T18:40:11.386700 #1224]  INFO -- : No differences
*** End octocatalog-diff on webapp1.internal.softwareheritage.org
$ bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging moma

Found host moma.softwareheritage.org
WARN     -> Environment "wip-pg-hba-rules-in-yaml" contained non-word characters, correcting name to wip_pg_hba_rules_in_yaml
Cloning into '/tmp/swh-ocd.A4w4YXhk/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.A4w4YXhk/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host moma.softwareheritage.org
I, [2021-04-26T18:40:49.355583 #8449]  INFO -- : Catalogs compiled for moma.softwareheritage.org
I, [2021-04-26T18:40:51.854403 #8449]  INFO -- : Diffs computed for moma.softwareheritage.org
diff origin/production/moma.softwareheritage.org current/moma.softwareheritage.org
*******************************************
+ Concat_fragment[profile::cron::refresh-savecodenow-statuses] =>
   parameters =>
      "order": "10"
      "tag": "profile::cron::logrotate-journal"
      "target": "profile::cron::logrotate-journal"
      "content": >>>
# Cron snippet refresh-savecodenow-statuses
* * * * * root chronic sh -c "/usr/bin/django-admin refresh_savecodenow_statuses"
<<<
*******************************************
+ Profile::Cron::D[refresh-savecodenow-statuses] =>
   parameters =>
      "command": "chronic sh -c \"/usr/bin/django-admin refresh_savecodenow_statuses\""
      "hour": "*"
      "minute": "*"
      "target": "logrotate-journal"
      "unique_tag": "refresh-savecodenow-statuses"
      "user": "root"
*******************************************
*** End octocatalog-diff on moma.softwareheritage.org

Migrated from D5616 (view on Phabricator)

Merge request reports

Loading