Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to load multiple backups in single command #708

Open
andrzejewsky opened this issue Oct 27, 2023 · 0 comments
Open

Allow to load multiple backups in single command #708

andrzejewsky opened this issue Oct 27, 2023 · 0 comments

Comments

@andrzejewsky
Copy link
Member

andrzejewsky commented Oct 27, 2023

Sometimes there is a need to load multiple backups at once for multiple environments. In most cases this reload happens agains backups that are compatible with given environment.

Currently, if we want to do this, we have to call backup command in a loop, passing there all of environments that we want to impact.

Proposal

We can have a command that will load backups for given environments that matches some pattern within its name/domain, where these backups are loaded accordingly to its compatibility. Examples below:

Command that loads backup name snapshot-automation-tests in version 3.15 for envs that match pattern staging.*:

saleor backup restore snapshot-automation-tests:3.15 --environment=staging.*

Command that loads backup name snapshot-automation-tests in latest compatible version for each env that match pattern staging.*:

saleor backup restore snapshot-automation-tests:latest --environment=staging.*

Note: considering this example, when we have env with on version 3.15 it seeks for snapshot-automation-tests in 3.15, if it's not present, it takes 3.14, and so on.

Command that loads backup name snapshot-automation-tests in version 3.15 for specific env:

saleor backup restore snapshot-automation-tests:3.15 --environment=test1

Command that loads backup name snapshot-automation-tests in latest compatible version that fits given env:

saleor backup restore snapshot-automation-tests:latest --environment=test1

Note: Assuming that test1 i on 3.14 it will take snapshot-automation-tests in version 3.14 first.

User prompt / CI
We have to also consider two options of executing it.

Default one when the user is calling this command by hand - in this case we have to present the user what envs will be affected and what backups in which version (each) will be used. (eg. table with columns: env - backup - version)

Second one, dedicated for the CI that just skips the prompt with confirmation and table that includes summary (--force kind of)

@andrzejewsky andrzejewsky added bug Something isn't working and removed bug Something isn't working labels Oct 27, 2023
@andrzejewsky andrzejewsky changed the title Allow to load multiple backups in sigle command Allow to load multiple backups in single command Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant