diff options
author | Aaron LI <aly@aaronly.me> | 2019-09-22 15:32:18 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2019-09-22 15:32:18 +0800 |
commit | dd30bd4252b0f199d2c55df861ea95a1acaf0403 (patch) | |
tree | c54e816727d84aee3d09d9812e625f855c643c10 /roles | |
parent | 1d2d14db6f719d50a95651c99ec19b69279c0ef5 (diff) | |
download | ansible-dfly-vps-dd30bd4252b0f199d2c55df861ea95a1acaf0403.tar.bz2 |
git: Rework the post-preceive hook for cgit-static repo
Diffstat (limited to 'roles')
-rw-r--r-- | roles/git/tasks/main.yml | 31 | ||||
-rw-r--r-- | roles/git/templates/cgit-static-deploy.j2 (renamed from roles/git/templates/cgit/post-receive.j2) | 0 |
2 files changed, 14 insertions, 17 deletions
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 6bec804..2dad95b 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -150,23 +150,6 @@ dest: "{{ git.cgit.root }}/syntax-highlighting.sh" mode: 0755 -- name: cgit - create static repo - become_user: "{{ git.user.name }}" - command: > - ./git-shell-commands/create - {{ git.cgit.static_repo }} - "cgit static resources repo" - args: - chdir: "{{ git.user.home }}" - creates: "{{ git.user.home }}/{{ git.cgit.static_repo }}" - -- name: cgit - add post-receive hook to the static repo - template: - src: cgit/post-receive.j2 - dest: "{{ git.user.home }}/{{ git.cgit.static_repo }}/hooks/post-receive" - owner: "{{ git.user.name }}" - mode: 0755 - - name: uwsgi - setup cgit blockinfile: path: /etc/rc.conf @@ -186,3 +169,17 @@ service: name: uwsgi state: restarted + +- name: (local) cgit - generate deploy hook for cgit-static repo + become: false + template: + src: cgit-static-deploy.j2 + dest: "{{ playbook_dir }}/gitolite-admin/local/hooks/repo-specific/cgit-static-deploy" + mode: 0755 + delegate_to: localhost + +- debug: + msg: + - "NOTE:" + - "Need to set the post-preceive hook for 'cgit-static' repo:" + - "gitolite-admin/local/hooks/repo-specific/cgit-static-deploy" diff --git a/roles/git/templates/cgit/post-receive.j2 b/roles/git/templates/cgit-static-deploy.j2 index 14b455a..14b455a 100644 --- a/roles/git/templates/cgit/post-receive.j2 +++ b/roles/git/templates/cgit-static-deploy.j2 |