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

Test the upgrade from the version 2.4.0 #4906

Merged
merged 2 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ dockerBuild {
}, 'Tests upgrades 230': {
test_upgrade('v230-docker', 'v230-docker', 'dockerref')
test_upgrade('v230-nondocker', 'v230-nondocker', 'nondockerref')
}, 'Tests upgrades 240': {
test_upgrade('v240', 'v240', 'dockerref')
}
}
stage('Publish') {
Expand Down
11 changes: 7 additions & 4 deletions docker-run
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ def main():
last_git_tag = subprocess.check_output([
'git', 'describe', '--abbrev=0', '--tags'
], stderr=subprocess.DEVNULL)
minor = subprocess.check_output([
'.venv/bin/python', 'travis/get-minor', '--no-save'
], stderr=subprocess.DEVNULL)
version = "{}.{}".format(last_git_tag, minor)
if os.path.exists('.venv'):
minor = subprocess.check_output([
'.venv/bin/python', 'travis/get-minor', '--no-save'
], stderr=subprocess.DEVNULL)
version = "{}.{}".format(last_git_tag, minor)
else:
version = ''
else:
version = git_branch
else:
Expand Down
34 changes: 31 additions & 3 deletions travis/test-upgrade-convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ then
create ${WORKSPACE}/dockerref
createnondocker ${WORKSPACE}/nondocker
createnondocker ${WORKSPACE}/nondockerref
create ${WORKSPACE}/v240 --version=2.4.0
create ${WORKSPACE}/v230-docker --version=2.3.1
createnondocker ${WORKSPACE}/v230-nondocker --version=2.3.1
mkdir --parent ${WORKSPACE}/v220
Expand Down Expand Up @@ -265,12 +266,10 @@ function v230 {
MAKE_ARGS='--makefile=testgeomapfish.mk'
DOCKER_ARGS='--env=VISIBLE_WEB_HOST=example.com --env=VISIBLE_WEB_PROTOCOL=https --env=VISIBLE_ENTRY_POINT=/'
fi
cp travis/from23-config ${WORKSPACE}/v230-$1docker/testgeomapfish/.config
cp travis/old-project.yaml ${WORKSPACE}/v230-$1docker/testgeomapfish/project.yaml.mako
cd ${WORKSPACE}/v230-$1docker/testgeomapfish
./docker-run ${DOCKER_ARGS} make ${MAKE_ARGS} project.yaml
cd -
cp travis/from23-config ${WORKSPACE}/v230-$1docker/testgeomapfish/.config
cd ${WORKSPACE}/v230-$1docker/testgeomapfish
git add project.yaml.mako .config
git commit --quiet --message="Start upgrade"
./docker-run --env=NODE_ENV make ${MAKE_ARGS} upgrade
Expand Down Expand Up @@ -320,6 +319,35 @@ then
v230 'non'
fi



function v240 {
cp travis/from23-config ${WORKSPACE}/v240/testgeomapfish/.config
cd ${WORKSPACE}/v240/testgeomapfish
./docker-run make project.yaml
git add project.yaml.mako .config
git commit --quiet --message="Start upgrade"
./docker-run --env=NODE_ENV make upgrade
./docker-run make --always-make --makefile=CONST_convert2tmpl.mk to-tmpl
if [ ! -e .UPGRADE_SUCCESS ]
then
printdiff
echo "Fail to upgrade"
exit 1
fi
./docker-run make clean-all
rm --recursive --force .UPGRADE* \
commons/testgeomapfish_commons.egg-info geoportal/testgeomapfish_geoportal.egg-info
cd -
find ${WORKSPACE}/v240 -type d -empty -delete
diff --recursive --exclude=.git ${WORKSPACE}/$1dockerref ${WORKSPACE}/v240
}

if [ "$1" = "v240" ]
then
v240
fi

if [ "$1" = "cleanup" ]
then
rm --recursive --force ${WORKSPACE}/nondockerref ${WORKSPACE}/dockerref \
Expand Down