-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create a method to upgrade core Odoo using Docker. Support v8=>9 and v9=>10
- Loading branch information
Showing
13 changed files
with
346 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM tecnativa/odoo-base:10.0 | ||
|
||
ARG ODOO_VERSION=10.0 | ||
|
||
ARG CONFIG_BUILD=true | ||
|
||
ENV ODOO_VERSION="$ODOO_VERSION" \ | ||
CONFIG_BUILD="$CONFIG_BUILD" | ||
|
||
CMD ["/opt/odoo/custom/src/upgrade-odoo"] | ||
|
||
# Metadata | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VERSION | ||
LABEL maintainer="LasLabs Inc <support@laslabs.com>" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.name="Odoo Upgrade v10" \ | ||
org.label-schema.description="Docker image used for upgrading Odoo v9 to v10 using OCA OpenUpgrade." \ | ||
org.label-schema.url="https://laslabs.com/" \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="https://github.com/LasLabs/docker-odoo-upgrade" \ | ||
org.label-schema.vendor="LasLabs Inc." \ | ||
org.label-schema.version=$VERSION \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
USER root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM tecnativa/odoo-base:9.0 | ||
|
||
ARG ODOO_VERSION=9.0 | ||
|
||
ARG CONFIG_BUILD=true | ||
|
||
ENV ODOO_VERSION="$ODOO_VERSION" \ | ||
CONFIG_BUILD="$CONFIG_BUILD" | ||
|
||
CMD ["/opt/odoo/custom/src/upgrade-odoo"] | ||
|
||
# Metadata | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VERSION | ||
LABEL maintainer="LasLabs Inc <support@laslabs.com>" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.name="Odoo Upgrade v9" \ | ||
org.label-schema.description="Docker image used for upgrading Odoo v8 to v9 using OCA OpenUpgrade." \ | ||
org.label-schema.url="https://laslabs.com/" \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="https://github.com/LasLabs/docker-odoo-upgrade" \ | ||
org.label-schema.vendor="LasLabs Inc." \ | ||
org.label-schema.version=$VERSION \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
USER root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rsync |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git+https://github.com/OCA/openupgradelib.git | ||
git+https://github.com/LasLabs/git-aggregator.git@feature/thread-download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
log INFO "Setting up the Postgres credentials" | ||
|
||
PGUSER_OLD=${PGUSER_OLD:=${PGUSER}} | ||
PGPASSWORD_OLD=${PGPASSWORD_OLD:=${PGPASSWORD}} | ||
|
||
cat <<EOF > ~/.pgpass | ||
db:5432:${DB_TARGET}:${PGUSER}:${PGPASSWORD} | ||
db_old:5432:${DB_SOURCE}:${PGUSER_OLD}:${PGPASSWORD_OLD} | ||
EOF | ||
|
||
chmod 0600 ~/.pgpass | ||
|
||
log INFO "Rsyncing the old file store to the new file store" | ||
# mkdir -p /var/lib/odoo/filestore/${DB_TARGET}/ | ||
# rsync -avz /var/lib/odoo_old/filestore/${DB_SOURCE}/ /var/lib/odoo/filestore/${DB_TARGET}/ | ||
|
||
log INFO "Creating a clone of the database for upgrade" | ||
# echo "CREATE DATABASE ${DB_TARGET};" | psql -h db | ||
# pg_dump -h db_old -Fc "${DB_SOURCE}" | pg_restore -h db -d "${DB_TARGET}" | ||
|
||
# log INFO "Upgrading database clone" | ||
# odoo -d "${DB_TARGET}" --workers 0 --stop-after-init --update "${ODOO_UPDATE:=all}" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Odoo is always required | ||
./odoo: | ||
defaults: | ||
# Shallow repositories (1=1) are faster & thinner | ||
# You may need a bigger depth when merging PRs | ||
depth: "$DEPTH_DEFAULT" | ||
remotes: | ||
openupgrade: https://github.com/OCA/OpenUpgrade.git | ||
target: | ||
openupgrade $ODOO_VERSION | ||
merges: | ||
- openupgrade $ODOO_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
log INFO "Upgrading database clone" | ||
odoo -d "${DB_TARGET}" --workers 0 --stop-after-init --update "${ODOO_UPDATE:=all}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
version: "2" | ||
|
||
services: | ||
|
||
postgresql: | ||
image: postgres:9.6-alpine | ||
environment: | ||
PGDATA: /var/lib/postgresql/data/pgdata | ||
POSTGRES_PASSWORD: odoo_password | ||
POSTGRES_USER: odoo_user | ||
volumes: | ||
- ~/postgresql_data/:/var/lib/postgresql/data/ | ||
|
||
# This is your original Odoo v8 deploy. | ||
# Use this as a reference for changes that need to be made in other sections | ||
# in order to match your actual deploy. | ||
# | ||
# odoo_v8: | ||
# image: your_organization/your_odoo_scaffold_image:8.0 | ||
# environment: | ||
# - PGDATABASE: odoo_v8 | ||
# - PGPASSWORD: odoo_password | ||
# - PGUSER: odoo_user | ||
# volumes: | ||
# - ~/odoo_v8_data:/var/lib/odoo | ||
# links: | ||
# - postgresql:db | ||
|
||
openupgrade_v9: | ||
image: laslabs/odoo-upgrade:9.0 | ||
volumes: | ||
- ~/odoo_v8_data:/var/lib/odoo_old | ||
- ~/odoo_v9_data:/var/lib/odoo | ||
environment: | ||
- DB_SOURCE: odoo_v8 | ||
- DB_TARGET: odoo_v9 | ||
- PGDATABASE: odoo_v9 | ||
- PGUSER: odoo_user | ||
- PGPASSWORD: odoo_password | ||
links: | ||
- postgresql:db | ||
- postgresql:db_old | ||
|
||
custom_upgrader: | ||
image: your_organization/your_odoo_scaffold_image:9.0 | ||
command: "autoupdate" | ||
volumes: | ||
- ~/odoo_v9_data:/var/lib/odoo | ||
environment: | ||
- PGDATABASE: odoo_v9 | ||
- PGUSER: odoo_user | ||
- PGPASSWORD: odoo_password | ||
links: | ||
- postgresql:db | ||
|
||
custom_upgrader: | ||
image: your_organization/your_odoo_scaffold_image:9.0 | ||
volumes: | ||
- ~/odoo_v9_data:/var/lib/odoo | ||
environment: | ||
- PGDATABASE: odoo_v9 | ||
- PGUSER: odoo_user | ||
- PGPASSWORD: odoo_password | ||
links: | ||
- postgresql:db |