Support db migration and initialization for Auto DevOps
Pre-requisite
-
requires charts/auto-deploy-app!7 (merged) -
requires gitlab-ci-yml!201 (merged)
What does this MR do?
if $DB_INITIALIZE
is present, deploy an initial release
where only $DB_INITIALIZE
is run in a special job (and deployments are
not rendered/loaded). This is then followed by second release with
deployments as usual.
if $DB_MIGRATE
, set this value which will trigger a pre-upgrade helm
hook.
Due to helm not supporting hook logs, this MR does not show the logs from the intialization and migration logs.
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/48004
Tasks
-
Document :
For an example Rails project :
-
We can set
DB_INITIALIZE
:cd /app && RAILS_ENV=production bin/setup
andDB_MIGRATE
:cd app && RAILS_ENV=production bin/update
-
/app
is from herokuish buildpacks. Can use$APP_PATH
too -
Also, there is only one chance to run
$DB_INITIALIZE
. If the first deploy successfully completes,$DB_INITIALIZE
will never be run again. If$DB_INITIALIZE
is present during the first deploy though and it errors or fails, that doesn't cound as a successfully first deploy
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Closes #48004 (closed)
Merge request reports
Activity
1 Message This merge request adds or changes files that require a review from the docs team. Docs Review
The following files require a review from the Documentation team:
doc/topics/autodevops/index.md
To make sure these changes are reviewed, mention
@gl-docsteam
in a separate comment, and explain what needs to be reviewed by the team. Please don't mention the team until your changes are ready for review.Generated by
DangerEdited by 🤖 GitLab Bot 🤖marked the checklist item Changelog entry added, if necessary as completed
added 35 commits
-
76a23d31...4ac62282 - 34 commits from branch
master
- 0cb0f3c1 - Process $DB_INITIALIZE and $DB_MIGRATE variables
-
76a23d31...4ac62282 - 34 commits from branch
mentioned in merge request charts/auto-deploy-app!7 (merged)
- Resolved by Thong Kuah
- Document :
What I had is
DB_INITIALIZE
:cd /app && RAILS_ENV=production bin/setup
andDB_MIGRATE
:cd app && RAILS_ENV=production bin/update
/app
is from herokuish buildpacks. Can use$APP_PATH
tooEdited by Thong Kuahmarked the checklist item Documentation created/updated as completed
marked the checklist item Conforms to the code review guidelines as completed
marked the checklist item Conforms to the merge request performance guidelines as completed
marked the checklist item Conforms to the style guides as completed
added 1 commit
- 681b7d7b - Document how to use DB_INITIALIZE and DB_MIGRATE
marked the checklist item Conforms to the database guides as completed
assigned to @axil
@axil could you please do a review of the docs in this. Thanks.
The
package-and-qa
job from pipeline https://gitlab.com/gitlab-org/gitlab-ce/pipelines/31759842 triggered https://gitlab.com/gitlab-org/omnibus-gitlab/pipelines/31764648 downstream.