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

[Feature] Provide a one-shot "upgrade only" mode? #13

Closed
Ezwen opened this issue Sep 7, 2023 · 5 comments
Closed

[Feature] Provide a one-shot "upgrade only" mode? #13

Ezwen opened this issue Sep 7, 2023 · 5 comments

Comments

@Ezwen
Copy link

Ezwen commented Sep 7, 2023

Currently this image is supposed to be used as a drop-in replacement for the official postgres image, with the extra auto-upgrade feature on top of it.

However, I would assume some people would still prefer to stick using the official postgres image as much as possible, but would still be interested in the upgrading procedure embedded in this image.

To be able to combine both worlds: could we imagine using this image just for upgrading, using a dedicated flag? For instance with such flag we would check the version, perform an upgrade if required, and just exit. Then after that one could continue using the official postgres image once the upgrade is done.

@justinclift
Copy link
Member

It would be possible to implement, but it's not a high priority.

If someone really wants to use this just for the upgrade portion of things then they can already do so.

They just need to switch to this image + start it up.

When the database comes online, that means the upgrade is done. At that point, they can shut down the database and switch to their desired "official" postgresql docker image and things should work fine.

In theory. 😁

@Ezwen
Copy link
Author

Ezwen commented Sep 7, 2023

It would be possible to implement, but it's not a high priority.

I understand, better to keep the project focused.

When the database comes online, that means the upgrade is done. At that point, they can shut down the database and switch to their desired "official" postgresql docker image and things should work fine.

Yes that's what I had in mind. I'll try do achieve this on my own, and report here if it works out OK :)

Thanks!

@justinclift
Copy link
Member

I'll try do achieve this on my own, and report here if it works out OK :)

@Ezwen Did you have a chance to try it out? 😄

justinclift added a commit that referenced this issue Mar 21, 2024
justinclift added a commit that referenced this issue Mar 21, 2024
@justinclift
Copy link
Member

Just added this "one shot" capability (d50f8c9).

To use it, add a new environment variable PGAUTO_ONESHOT (set to yes) in the container when pgautoupgrade runs.

When it sees that environment variable, it'll exit after doing the upgrade instead of starting a PostgreSQL server.

New Docker images have been generated and pushed to Docker Hub.

If anyone wants to try it out and report back any weirdness (shouldn't be any though), that'd be cool. 😄

@justinclift
Copy link
Member

Closing this as it was done a while back. 😄

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

2 participants