Skip to content
Snippets Groups Projects
Commit 2808ca9d9495 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

docker_build: copy modules (defined in setup.cfg in superproject to a new...

docker_build: copy modules (defined in setup.cfg in superproject to a new directory for docker to do)
parent 47bb259df284
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,13 @@
History
=======
2.8
---
- add script to create archive of source
- create_documentation: only create documentation for used modules, reusing the setup.cfg key defined for create_archive if it is present
- docker_build: copy modules (defined in setup.cfg in superproject to a new directory for docker to do)
2.7
---
......
2.7
2.8
......@@ -13,7 +13,7 @@
#
# - access to pg database
#
# Version 2.7
# Version 2.8
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
......
#!/bin/zsh
# template version 2.7
# vim: set shiftwidth=4 softtabstop=4:
# Create docker script
# template version 2.8
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
......@@ -3,6 +7,7 @@
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
project_home=$(dirname $0)/..
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
registry=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'registry') and c.get('odoo_scripts', 'registry')) or 'dockerhub.xcg.io'")
image=$(basename $(readlink -f $project_home))
ignore_git=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'ignore_git') and c.get('odoo_scripts', 'ignore_git')) or 'False'")
......@@ -6,7 +11,6 @@
registry=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'registry') and c.get('odoo_scripts', 'registry')) or 'dockerhub.xcg.io'")
image=$(basename $(readlink -f $project_home))
ignore_git=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_section('odoo_scripts') and c.has_option('odoo_scripts', 'ignore_git') and c.get('odoo_scripts', 'ignore_git')) or 'False'")
pushd $project_home
docker_module_dir=
# Ensureconf
......@@ -11,5 +15,6 @@
# Ensureconf
pushd $project_home
if [ "$ignore_git" = "True" ];
then
hg cfensureconf || echo "ignore all cfensureconf errors to bypass bad error code with git repositories"
......@@ -18,6 +23,8 @@
fi
popd
$here/docker_build_copy
docker build --pull=true --rm=true -t $registry/$image $project_home || { echo 'Build failed' ; exit 1; }
# tip is latest in docker
......@@ -38,3 +45,6 @@
echo "Pushing docker image"
docker push $registry/$image || { echo 'Push failed' ; exit 1; }
$here/docker_build_clean
#!/bin/zsh
# vim: set shiftwidth=4 softtabstop=4:
# Create docker script (clean)
# template version 2.7
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
odoo_modules=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and c.get('odoo_scripts', 'modules') or '')")
# Delete odoo modules temp directory
if [[ -n $odoo_modules ]];
then
echo rm -rf $project_home/odoo_modules
fi
#!/bin/zsh
# vim: set shiftwidth=4 softtabstop=4:
# Create docker script (copy)
# template version 2.7
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
odoo_modules=$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and c.get('odoo_scripts', 'modules') or '')")
# Copy modules when specified
if [[ -n $odoo_modules ]];
then
mkdir -p $project_home/odoo_modules
rsync --delete --exclude='.hg*' --exclude='.git*' --links --exclude='*.pyc' -r $(eval echo $odoo_modules) $project_home/odoo_modules
fi
......@@ -4,7 +4,7 @@
# This script is used to run tests on a database with demo data installed.
#
# Either provide the name of the database (first argument) or it will default to <project>_test
# Version 2.7
# Version 2.8
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
tested_modules=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print ','.join(c.get('odoo_scripts', 'module_list_tests', '').split())")
......
[bumpversion]
current_version = 2.7
current_version = 2.8
parse = (?P<major>\d+)\.(?P<minor>\d+)
serialize =
{major}.{minor}
......
......@@ -5,7 +5,7 @@
#
# You can set ODOO_DATA_DIR and ODOO_DB_HOST if you want to avoid using the default value ($HOME/var/tmp and localhost)
#
# Version 2.7
# Version 2.8
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
echo "Starting odoo for development"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment