Skip to content

Commit

Permalink
fix: upgrade_from_maple issue
Browse files Browse the repository at this point in the history
fix: Migration needed before upgrade_from_maple issue #689
  • Loading branch information
ibrmora authored and regisb committed Jun 13, 2022
1 parent 8b31237 commit e57e6cb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Every user-facing change should have an entry in this changelog. Please respect

## Unreleased

- [Bugfix] Add migration to "upgrade_from_maple" function ([#689](https://github.com/overhangio/tutor/issues/689)). (by @ibrmora)

## v14.0.0 (2022-06-09)

- 💥[Feature] Upgrade to Nutmeg: (by @regisb)
Expand Down
20 changes: 20 additions & 0 deletions tutor/commands/upgrade/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def upgrade_from_maple(context: Context, config: Config) -> None:
"app.kubernetes.io/name=lms",
)
k8s.wait_for_pod_ready(config, "lms")

# Command backpopulate_user_tours
k8s.kubectl_exec(
config, "lms", ["sh", "-e", "-c", "./manage.py lms migrate user_tours"]
)
k8s.kubectl_exec(
config, "lms", ["sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"]
)
Expand All @@ -140,9 +145,24 @@ def upgrade_from_maple(context: Context, config: Config) -> None:
"app.kubernetes.io/name=cms",
)
k8s.wait_for_pod_ready(config, "cms")

# Command backfill_course_tabs
k8s.kubectl_exec(
config, "cms", ["sh", "-e", "-c", "./manage.py cms migrate contentstore"]
)
k8s.kubectl_exec(
config,
"cms",
["sh", "-e", "-c", "./manage.py cms migrate split_modulestore_django"],
)
k8s.kubectl_exec(
config, "cms", ["sh", "-e", "-c", "./manage.py cms backfill_course_tabs"]
)

# Command simulate_publish
k8s.kubectl_exec(
config, "cms", ["sh", "-e", "-c", "./manage.py cms migrate course_overviews"]
)
k8s.kubectl_exec(
config, "cms", ["sh", "-e", "-c", "./manage.py cms simulate_publish"]
)
25 changes: 25 additions & 0 deletions tutor/commands/upgrade/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,39 @@ def upgrade_from_maple(context: click.Context, config: Config) -> None:
click.echo(fmt.title("Upgrading from Maple"))
# The environment needs to be updated because the management commands are from Nutmeg
tutor_env.save(context.obj.root, config)
# Command backpopulate_user_tours
context.invoke(
compose.run,
args=["lms", "sh", "-e", "-c", "./manage.py lms migrate user_tours"],
)
context.invoke(
compose.run,
args=["lms", "sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"],
)
# Command backfill_course_tabs
context.invoke(
compose.run,
args=["cms", "sh", "-e", "-c", "./manage.py cms migrate contentstore"],
)
context.invoke(
compose.run,
args=[
"cms",
"sh",
"-e",
"-c",
"./manage.py cms migrate split_modulestore_django",
],
)
context.invoke(
compose.run,
args=["cms", "sh", "-e", "-c", "./manage.py cms backfill_course_tabs"],
)
# Command simulate_publish
context.invoke(
compose.run,
args=["cms", "sh", "-e", "-c", "./manage.py cms migrate course_overviews"],
)
context.invoke(
compose.run,
args=["cms", "sh", "-e", "-c", "./manage.py cms simulate_publish"],
Expand Down

0 comments on commit e57e6cb

Please sign in to comment.