summaryrefslogtreecommitdiff
path: root/per-service/git-servers/roles/cgit/tasks/main.yml
blob: d3dfbac91da0b8fd67d8f6bb63faa3403a0aa200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
- name: Ensure cgit directory exists
  file: path={{ apache_root }}/cgit state=directory mode=0755 owner=git group=git

- name: Ensure cgit css directory exists
  file: path={{ apache_root }}/cgit/cgit-css state=directory mode=0755

- name: Install cgitrc file
  template: src=cgitrc dest=/etc/cgitrc

- name: Install cgit dependencies
  apt: name={{ item }}
  with_items:
    - gcc
    - libssl-dev
    - make
    - python3-markdown
    - python3-docutils

# cgit isn't available in Trusty and we have patches not available in Xenial,
# so we install this by hand in the most idempotent way we can:
- name: Clone cgit repository
  git:  name=https://git.linaro.org/infrastructure/cgit
        dest={{ tools_checkout_dir }}/cgit
        version="linaro-patches" track_submodules=no
  register: cgit_repo

- name: Build cgit
  when: cgit_repo|changed
  command: make
           chdir={{ tools_checkout_dir }}/cgit

- name: Link cgit css into apache directory
  file: src={{ tools_checkout_dir }}/cgit/cgit.css
        dest={{ apache_root }}/cgit/cgit-css/cgit.css
        state=link

- name: Install header.html
  template: src=header.html dest={{ apache_root }}/cgit/header.html mode=0755

- name: Create a wrapper script to the cgit binary
  copy: dest={{ apache_root }}/cgit/cgit owner=git group=git mode=0755
        content="#!/bin/sh\n{{ tools_checkout_dir }}/cgit/cgit\n"

- name: Create a symlink for rst2html.py
  file: src=/usr/bin/rst2html dest=/usr/bin/rst2html.py state=link