Skip to content

Commit

Permalink
Merge pull request #10 from sebalix/fix-issue-8
Browse files Browse the repository at this point in the history
[IMP] New option 'odoo_repo_update' (default to True) to have more control on the repository checkout (fix issue #8)
  • Loading branch information
sebalix committed Jan 2, 2015
2 parents 57fedb4 + 219b729 commit ea45555
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ odoo_repo_type: git # git or hg
odoo_repo_url: https://github.com/odoo/odoo.git
odoo_repo_dest: "{{ odoo_rootdir }}"
odoo_repo_rev: 8.0
odoo_repo_update: True # Update the working copy or not. This option is
# ignored on the first run (a checkout of the working
# copy is always processed on the given revision)
# WARNING: uncommited changes will be discarded!

# Odoo parameters
odoo_config_addons_path: "/home/{{ odoo_user }}/odoo/server/addons,/home/{{ odoo_user }}/odoo/server/openerp/addons"
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ odoo_repo_type: git # git or hg
odoo_repo_url: https://github.com/odoo/odoo.git
odoo_repo_dest: "{{ odoo_rootdir }}"
odoo_repo_rev: 8.0
odoo_repo_update: True # Update the working copy or not. This option is
# ignored on the first run (a checkout of the working
# copy is always processed on the given revision)
# WARNING: uncommited changes will be discarded!

# Configuration options
odoo_config_addons_path: "/home/{{ odoo_user }}/odoo/server/addons,/home/{{ odoo_user }}/odoo/server/openerp/addons"
Expand Down
10 changes: 5 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- odoo
- odoo_log

- name: Project repository exists? (Mercurial)
- name: Project repository already cloned?
stat: path={{ odoo_repo_dest }}
register: project_path
tags:
Expand All @@ -48,8 +48,8 @@
hg: repo={{ odoo_repo_url }}
dest={{ odoo_repo_dest }}
revision={{ odoo_repo_rev }}
force=no
when: odoo_repo_type == 'hg' and project_path.stat.exists == False and odoo_repo_url
when: odoo_repo_type == 'hg' and odoo_repo_url
and (odoo_repo_update or (project_path.stat.exists == False))
tags:
- odoo
- odoo_project
Expand All @@ -59,8 +59,8 @@
git: repo={{ odoo_repo_url }}
dest={{ odoo_repo_dest }}
version={{ odoo_repo_rev }}
update=no
force=no
update={{ project_path.stat.exists == False and 'yes'
or (odoo_repo_update and 'yes' or 'no') }}
when: odoo_repo_type == 'git' and odoo_repo_url
tags:
- odoo
Expand Down

0 comments on commit ea45555

Please sign in to comment.