Skip to content

cmd/server: Postgres auto-upgrade procedure

Warren Gifford requested to merge tsenart/postgres-11-server-image into master

Created by: tsenart

This change-set introduces a fully automated and self-contained Postgres upgrade procedure we can use going forward for major version Postgres upgrades.

For the upgrade procedure, user's need to mount the Docker socket when running the image so that we can use https://github.com/tianon/docker-postgres-upgrade/ for the upgrade.

TODO


  • Tag 3.0.1 release when all of the above is done. Kick-off announcement.

Part of #1404 (closed)

$ docker run -p 7080:7080 -p 2633:2633 --rm \
  -v ~/.sourcegraph/config:/etc/sourcegraph \
  -v ~/.sourcegraph/data:/var/opt/sourcegraph \
  -v /var/run/docker.sock:/var/run/docker.sock \
  sourcegraph/server:3.0.1

✱ Sourcegraph is upgrading its internal database. Please don't interrupt this operation.
01:35:58           postgres | 2019-02-04 01:35:58.341 UTC [77] LOG:  listening on IPv4 address "127.0.0.1", port 5432
01:35:59 management-console | t=2019-02-04T01:35:59+0000 lvl=info msg="management-console: listening" addr=:2633
01:36:01           frontend |  
01:36:01           frontend |                    ╓╦╬╬╬╦╖
01:36:01           frontend |                   ╬╬╬╬╬╬╬╬╬
01:36:01           frontend |                  ╞╬╬╬╬╬╬╬╬╬╬           ╓╦╦╦╦┐
01:36:01           frontend |                   ╬╬╬╬╬╬╬╬╬╬╕        ╔╪╪╪╪╪╪╪╪╕
01:36:01           frontend |                   ╘╬╬╬╬╬╬╬╬╬╬      ╔╪╪╪╪╪╪╪╪╪╪╪
01:36:01           frontend |                    ╬╬╬╬╬╬╬╬╬╬╗   ╔╪╪╪╪╪╪╪╪╪╪╪╪┘
01:36:01           frontend |       ╓╦╦╖┐         ╬╬╬╬╬╬╬╬╬╬ ╔╝╪╪╪╪╪╪╪╪╪╪╪╜
01:36:01           frontend |     ╬╪╪╪╪╪╪╪╪╬╗╦╖   ╠╬╬╬╬╬╬╬╬╝╪╪╪╪╪╪╪╪╪╪╪╪╜
01:36:01           frontend |    ╠╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╝╝╬╬╬╬╝╪╪╪╪╪╪╪╪╪╪╪╪╜
01:36:01           frontend |    └╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╩
01:36:01           frontend |      ╙╩╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╖
01:36:01           frontend |           └╙╩╬╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╬╦╗┐
01:36:01           frontend |                  ╙╜╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╗╦╖
01:36:01           frontend |                  ┌╬╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╬
01:36:01           frontend |                ┌╗╪╪╪╪╪╪╪╪╪╪╪╪╬╬╬╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪╪
01:36:01           frontend |              ┌╗╪╪╪╪╪╪╪╪╪╪╪╪╬╬╬╬╬╬╬╬╬ ╙╜╩╪╪╪╪╪╪╪╪╪╪╪╪╜
01:36:01           frontend |            ┌╦╪╪╪╪╪╪╪╪╪╪╪╝╙╬╬╬╬╬╬╬╬╬╬       └╙╩╬╪╪╝╜
01:36:01           frontend |           ╦╪╪╪╪╪╪╪╪╪╪╪╪┘  ╠╬╬╬╬╬╬╬╬╬╬
01:36:01           frontend |          ╬╪╪╪╪╪╪╪╪╪╪╪┘     ╬╬╬╬╬╬╬╬╬╬┐
01:36:01           frontend |          ╙╪╪╪╪╪╪╪╪╪╜       ╘╬╬╬╬╬╬╬╬╬╬
01:36:01           frontend |           └╩╪╪╪╪╝╙          ╬╬╬╬╬╬╬╬╬╬╕
01:36:01           frontend |                             └╬╬╬╬╬╬╬╬╬╛
01:36:01           frontend |                               ╩╬╬╬╬╬╬┘
01:36:01           frontend |  
01:36:01           frontend | ✱ Sourcegraph is ready at: http://127.0.0.1:7080

Merge request reports

Loading