summaryrefslogtreecommitdiff
path: root/per-service
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-09-09 16:18:35 -0500
committerAndy Doan <andy.doan@linaro.org>2016-09-21 15:13:46 +0000
commitb83e9d01fd3c9e0608d4e2d9481a921caca98da1 (patch)
treec44e879ab3f066bc1472f9cb5856541d0f67aab9 /per-service
parentf96b1e5892a5cd161b4811f82e59f6fcc450fe54 (diff)
downloadansible-playbooks-b83e9d01fd3c9e0608d4e2d9481a921caca98da1.tar.gz
Add support for cgit UI
This is for evaluation mode at the moment and will run along side gitweb until we are ready to replace it. This currently only works on private repos, while I sort a way to better handle them upstream Change-Id: I7b895d26f3999e424da98676b0e091e73ad60af4 Reviewed-on: https://review.linaro.org/14381 Reviewed-by: Andy Doan <andy.doan@linaro.org>
Diffstat (limited to 'per-service')
-rw-r--r--per-service/git-servers/files/git.linaro.org.conf16
-rw-r--r--per-service/git-servers/gitolite.yml1
-rw-r--r--per-service/git-servers/roles/cgit/tasks/main.yml42
-rw-r--r--per-service/git-servers/roles/cgit/templates/cgitrc71
4 files changed, 130 insertions, 0 deletions
diff --git a/per-service/git-servers/files/git.linaro.org.conf b/per-service/git-servers/files/git.linaro.org.conf
index 2f3d843..0d7c48c 100644
--- a/per-service/git-servers/files/git.linaro.org.conf
+++ b/per-service/git-servers/files/git.linaro.org.conf
@@ -128,6 +128,14 @@ SuexecUserGroup {{ git_user }} {{ git_user }}
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* /gitweb.cgi/$0 [B,passthrough,last]
</Directory>
+
+ ScriptAlias /cgit/ "{{ apache_root}}/cgit/cgit/"
+ RedirectMatch ^/cgit$ /cgit/
+ <Directory "{{ apache_root }}/cgit/">
+ AllowOverride None
+ Options ExecCGI FollowSymlinks
+ Require all granted
+ </Directory>
</VirtualHost>
<VirtualHost *:443>
@@ -269,4 +277,12 @@ SuexecUserGroup {{ git_user }} {{ git_user }}
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* /gitweb.cgi/$0 [B,passthrough,last]
</Directory>
+
+ ScriptAlias /cgit/ "{{ apache_root}}/cgit/cgit/"
+ RedirectMatch ^/cgit$ /cgit/
+ <Directory "{{ apache_root }}/cgit/">
+ AllowOverride None
+ Options ExecCGI FollowSymlinks
+ Require all granted
+ </Directory>
</VirtualHost>
diff --git a/per-service/git-servers/gitolite.yml b/per-service/git-servers/gitolite.yml
index 6fd7cdc..fd6c5a4 100644
--- a/per-service/git-servers/gitolite.yml
+++ b/per-service/git-servers/gitolite.yml
@@ -18,6 +18,7 @@
- {role: apache-website, tags: [website-conf]}
- {role: apache-site, src: "{{git_host}}.conf", config: "{{git_host}}", tags: [apache, website-conf] }
- {role: cronjobs}
+ - {role: cgit, when: server_access == "public", tags: [cgit]}
- {role: gitweb, tags: [gitweb]}
- {role: upstart-git-daemon, when: server_access == "public", tags: [upstart]}
- {role: grokmirror, when: grokmirror_slave or grokmirror_master, tags: [grokmirror]}
diff --git a/per-service/git-servers/roles/cgit/tasks/main.yml b/per-service/git-servers/roles/cgit/tasks/main.yml
new file mode 100644
index 0000000..31a6ca5
--- /dev/null
+++ b/per-service/git-servers/roles/cgit/tasks/main.yml
@@ -0,0 +1,42 @@
+- 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: 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
diff --git a/per-service/git-servers/roles/cgit/templates/cgitrc b/per-service/git-servers/roles/cgit/templates/cgitrc
new file mode 100644
index 0000000..ccdee0e
--- /dev/null
+++ b/per-service/git-servers/roles/cgit/templates/cgitrc
@@ -0,0 +1,71 @@
+# {{ MANAGED_HEADER }}
+#
+# cgit config
+# see cgitrc(5) for details
+
+css=/cgit-css/cgit.css
+logo=/cgit-css/cgit.png
+
+virtual-root=/cgit/
+strict-export=git-daemon-export-ok
+enable-git-config=1
+enable-index-owner=0
+clone-prefix=https://{{git_host}} ssh://git@{{git_host}}
+snapshots=tar.gz
+
+root-title=Linaro Git Repositories
+root-desc=Git repositories hosted by Linaro
+logo=https://{{git_host}}/git-logo.png
+
+max-repo-count=2000
+
+readme=:README.md
+readme=:readme.md
+readme=:README.mkd
+readme=:readme.mkd
+readme=:README.rst
+readme=:readme.rst
+readme=:README.html
+readme=:readme.html
+readme=:README.htm
+readme=:readme.htm
+readme=:README.txt
+readme=:readme.txt
+readme=:README
+readme=:readme
+readme=:INSTALL.md
+readme=:install.md
+readme=:INSTALL.mkd
+readme=:install.mkd
+readme=:INSTALL.rst
+readme=:install.rst
+readme=:INSTALL.html
+readme=:install.html
+readme=:INSTALL.htm
+readme=:install.htm
+readme=:INSTALL.txt
+readme=:install.txt
+readme=:INSTALL
+readme=:install
+
+about-filter={{tools_checkout_dir}}/cgit/filters/about-formatting.sh
+
+section-from-path=1
+scan-path={{repo_root}}
+
+section-collapse=boot
+section-collapse=bsp
+section-collapse=ci
+section-collapse=devops
+section-collapse=gpgpu
+section-collapse=gwg
+section-collapse=hwpack
+section-collapse=infrastructure
+section-collapse=kernel-org
+section-collapse=landing-teams
+section-collapse=lava-team
+section-collapse=people
+section-collapse=pkg
+section-collapse=pmo-process
+section-collapse=ubuntu
+section-collapse=zephyrproject-org