diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d533a400..cb93c942e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Run `db_migrate` jobs before starting new pods in a deployment + ## [4.3.0] - 2019-12-13 ### Added diff --git a/apps/edxapp/templates/services/cms/job_05_db_migrate.yml.j2 b/apps/edxapp/templates/services/cms/job_05_db_migrate.yml.j2 index 0df90d293..51c14634e 100644 --- a/apps/edxapp/templates/services/cms/job_05_db_migrate.yml.j2 +++ b/apps/edxapp/templates/services/cms/job_05_db_migrate.yml.j2 @@ -6,10 +6,12 @@ metadata: namespace: "{{ project_name }}" labels: app: edxapp + deployment_stamp: "{{ deployment_stamp }}" + job_stamp: "{{ job_stamp }}" + # Jobs with the "pre" job type will be executed prior to deployments + job_type: "pre" service: cms version: "{{ edxapp_image_tag }}" - job_stamp: "{{ job_stamp }}" - deployment_stamp: "{{ deployment_stamp }}" spec: template: metadata: diff --git a/apps/edxapp/templates/services/lms/job_04_db_migrate.yml.j2 b/apps/edxapp/templates/services/lms/job_04_db_migrate.yml.j2 index bbfc4b8eb..a164bb232 100644 --- a/apps/edxapp/templates/services/lms/job_04_db_migrate.yml.j2 +++ b/apps/edxapp/templates/services/lms/job_04_db_migrate.yml.j2 @@ -6,10 +6,12 @@ metadata: namespace: "{{ project_name }}" labels: app: edxapp + deployment_stamp: "{{ deployment_stamp }}" + job_stamp: "{{ job_stamp }}" + # Jobs with the "pre" job type will be executed prior to deployments + job_type: "pre" service: lms version: "{{ edxapp_image_tag }}" - job_stamp: "{{ job_stamp }}" - deployment_stamp: "{{ deployment_stamp }}" spec: template: metadata: diff --git a/apps/learninglocker/templates/services/app/job_db_migrate.yml.j2 b/apps/learninglocker/templates/services/app/job_db_migrate.yml.j2 index 7d5682825..e3b1a7180 100644 --- a/apps/learninglocker/templates/services/app/job_db_migrate.yml.j2 +++ b/apps/learninglocker/templates/services/app/job_db_migrate.yml.j2 @@ -7,10 +7,12 @@ metadata: namespace: "{{ project_name }}" labels: app: learninglocker + deployment_stamp: "{{ deployment_stamp }}" + job_stamp: "{{ job_stamp }}" + # Jobs with the "pre" job type will be executed prior to deployments + job_type: "pre" service: learninglocker version: "{{ learninglocker_image_tag }}" - job_stamp: "{{ job_stamp }}" - deployment_stamp: "{{ deployment_stamp }}" spec: template: metadata: diff --git a/apps/marsha/templates/services/app/job_db_migrate.yml.j2 b/apps/marsha/templates/services/app/job_db_migrate.yml.j2 index b504ae090..f6de354fc 100644 --- a/apps/marsha/templates/services/app/job_db_migrate.yml.j2 +++ b/apps/marsha/templates/services/app/job_db_migrate.yml.j2 @@ -5,10 +5,12 @@ metadata: namespace: "{{ project_name }}" labels: app: marsha - service: marsha - version: "{{ marsha_image_tag }}" deployment_stamp: "{{ deployment_stamp }}" job_stamp: "{{ job_stamp }}" + # Jobs with the "pre" job type will be executed prior to deployments + job_type: "pre" + service: marsha + version: "{{ marsha_image_tag }}" spec: template: metadata: diff --git a/apps/richie/templates/services/app/job_02_db_migrate.yml.j2 b/apps/richie/templates/services/app/job_02_db_migrate.yml.j2 index ebbfd674e..fba1b314e 100644 --- a/apps/richie/templates/services/app/job_02_db_migrate.yml.j2 +++ b/apps/richie/templates/services/app/job_02_db_migrate.yml.j2 @@ -5,10 +5,12 @@ metadata: namespace: "{{ project_name }}" labels: app: richie - service: richie - version: "{{ richie_image_tag }}" deployment_stamp: "{{ deployment_stamp }}" job_stamp: "{{ job_stamp }}" + # Jobs with the "pre" job type will be executed prior to deployments + job_type: "pre" + service: richie + version: "{{ richie_image_tag }}" spec: template: metadata: