# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1481820753 -3600 # Thu Dec 15 17:52:33 2016 +0100 # Node ID 2808ca9d9495c6b05ff3b29ffd5953f870e26884 # Parent 47bb259df2845fee6a5cd6f9c38cb4ecf825d145 docker_build: copy modules (defined in setup.cfg in superproject to a new directory for docker to do) diff --git a/HISTORY.rst b/HISTORY.rst --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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 --- diff --git a/VERSION b/VERSION --- a/VERSION +++ b/VERSION @@ -1,1 +1,1 @@ -2.7 +2.8 diff --git a/do_tests b/do_tests --- a/do_tests +++ b/do_tests @@ -13,7 +13,7 @@ # # - access to pg database # -# Version 2.7 +# Version 2.8 here=$(dirname $0) project_home=$(cd $here && cd .. && echo $PWD) diff --git a/docker_build b/docker_build --- a/docker_build +++ b/docker_build @@ -1,15 +1,20 @@ #!/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 -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'") - -pushd $project_home +docker_module_dir= # 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 + diff --git a/docker_build_clean b/docker_build_clean new file mode 100755 --- /dev/null +++ b/docker_build_clean @@ -0,0 +1,18 @@ +#!/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 + diff --git a/docker_build_copy b/docker_build_copy new file mode 100755 --- /dev/null +++ b/docker_build_copy @@ -0,0 +1,19 @@ +#!/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 + diff --git a/run_tests b/run_tests --- a/run_tests +++ b/run_tests @@ -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())") diff --git a/setup.cfg b/setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.7 +current_version = 2.8 parse = (?P<major>\d+)\.(?P<minor>\d+) serialize = {major}.{minor} diff --git a/start b/start --- a/start +++ b/start @@ -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"