Skip to content

Commit

Permalink
Fix upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 19, 2019
1 parent 44bae89 commit 71e7535
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ jobs:
- run: docker-compose down

# Documentation
- run: docker build --tag=camptocamp/geomapfish-doc --build-arg=MAJOR_VERSION=${MAJOR_VERSION} doc
- run: >
docker build --tag=camptocamp/geomapfish-doc
--build-arg=MAJOR_VERSION=${MAJOR_VERSION}
--build-arg=MAIN_BRANCH=${MAIN_BRANCH}
doc
- run:
command: docker images
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ ARG VERSION
ENV VERSION=$VERSION

WORKDIR /src
COPY bin/run /usr/bin/
COPY bin/run bin/run-git /usr/bin/
COPY --from=build-upgrade /app/c2cgeoportal/commons /opt/c2cgeoportal_commons
COPY --from=build-upgrade /app/c2cgeoportal/geoportal /opt/c2cgeoportal_geoportal

Expand Down
6 changes: 6 additions & 0 deletions bin/run-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -e

git config --global user.name "$1"
git config --global user.email $2
shift 2
run "$@"
2 changes: 1 addition & 1 deletion ci/publish
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ then
fi

# Publish the GeoMapFish images
for IMAGE in geomapfish geomapfish-build geomapfish-scaffolds geomapfish-config-build geomapfish-geoportal
for IMAGE in geomapfish geomapfish-build geomapfish-config geomapfish-config-build geomapfish-scaffolds geomapfish-geoportal
do
docker tag camptocamp/${IMAGE} camptocamp/${IMAGE}:${VERSION}
docker push camptocamp/${IMAGE}:${VERSION}
Expand Down
1 change: 1 addition & 0 deletions doc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN \
rm --recursive --force /tmp/* /var/tmp/* /root/.cache/*

ARG MAJOR_VERSION
ARG MAIN_BRANCH

COPY . /doc
WORKDIR /doc
Expand Down
6 changes: 6 additions & 0 deletions doc/integrator/upgrade_application.rst.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Build the project file if needed (2.4):

./docker-run make project.yaml

For 2.4 you also should clean your project (include ignored files):

.. prompt:: bash

git clean -dx --force

Get the upgrade script:

.. prompt:: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ COMPOSE_PROJECT_NAME={{package}}
DOCKER_PORT=8484
DOCKER_BASE=camptocamp/{{package}}
DOCKER_TAG=latest
VISIBLE_WEB_HOST=localhost
VISIBLE_WEB_HOST=localhost:8484
VISIBLE_WEB_PROTOCOL=https
VISIBLE_ENTRY_POINT=/
PGHOST=db
Expand Down
2 changes: 1 addition & 1 deletion geoportal/c2cgeoportal_geoportal/scripts/c2cupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def step10(self, step):

message = [
"The upgrade is nearly done, now you should:",
"- Build your application with ./upgrade PACKAGE [DOCKER_TAG]."
"- Build your application with ./upgrade finalise PACKAGE [DOCKER_TAG].",
"- Test your application on '{}'.".format(
self.project.get('application_url', '... missing ...')
)
Expand Down
12 changes: 11 additions & 1 deletion scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ fi
if [ $# -gt 1 ]
then
args="--step $2"
else
if [ "$CI" != "true" ]
then
docker pull camptocamp/geomapfish:$1
docker pull camptocamp/geomapfish-build:$1
docker pull camptocamp/geomapfish-config:$1
docker pull camptocamp/geomapfish-config-build:$1
docker pull camptocamp/geomapfish-scaffolds:$1
fi
fi

docker run --rm --volume=${PWD}:/src camptocamp/geomapfish-scaffolds:$1 \
run $(id -u) $(id -g) /src c2cupgrade $args
run-git "$(git config --get user.name)" $(git config --get user.email) $(id -u) $(id -g) \
/src c2cupgrade $args

0 comments on commit 71e7535

Please sign in to comment.