summaryrefslogtreecommitdiff
path: root/roles/git
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-02 17:03:49 +0100
committerIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-02 17:03:49 +0100
commit397c4fed757d201af627636822981e85e84ea572 (patch)
treed6733d4022bf04784be84581f6c16e96a1b229e8 /roles/git
downloadAnsible-397c4fed757d201af627636822981e85e84ea572.tar.gz
Ansible-397c4fed757d201af627636822981e85e84ea572.tar.zst
Ansible-397c4fed757d201af627636822981e85e84ea572.zip
Validation initiale
Diffstat (limited to 'roles/git')
-rwxr-xr-xroles/git/files/config_files/git/templates_fretlink/hooks/pre-push8
-rw-r--r--roles/git/files/config_files/tig/config19
-rw-r--r--roles/git/tasks/main.yml21
-rw-r--r--roles/git/templates/config.j223
4 files changed, 71 insertions, 0 deletions
diff --git a/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push b/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push
new file mode 100755
index 0000000..19088c9
--- /dev/null
+++ b/roles/git/files/config_files/git/templates_fretlink/hooks/pre-push
@@ -0,0 +1,8 @@
1#!/usr/bin/env bash
2
3set -e
4
5echo "[+] Running the linter"
6make lint
7
8exit 0
diff --git a/roles/git/files/config_files/tig/config b/roles/git/files/config_files/tig/config
new file mode 100644
index 0000000..e9cdf17
--- /dev/null
+++ b/roles/git/files/config_files/tig/config
@@ -0,0 +1,19 @@
1set editor-line-number = yes
2set mouse = yes
3set mouse-scroll = 5
4set refresh-mode = auto
5set line-graphics = utf-8
6
7set pager-view-line-number = yes,interval=10
8set blame-view-line-number = yes,interval=10
9set grep-view-line-number = yes,interval=10
10set diff-view-line-number = yes,interval=10
11set log-view-line-number = yes,interval=10
12set blob-view-line-number = yes,interval=10
13set stage-view-line-number = yes,interval=10
14
15set main-view-commit-title = graph=v1,refs=yes
16set refs-view-commit-title = graph=v1,refs=yes
17set stash-view-commit-title = graph=v1,refs=yes
18
19set refs-view-ref = display=yes
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml
new file mode 100644
index 0000000..440e178
--- /dev/null
+++ b/roles/git/tasks/main.yml
@@ -0,0 +1,21 @@
1---
2- name: Config files
3 synchronize:
4 recursive: yes
5 archive: no
6 checksum: yes
7 src: config_files/
8 dest: /$XDG_CONFIG_HOME/
9- name: git config file
10 template:
11 src: config.j2
12 dest: $XDG_CONFIG_HOME/git/config
13- name: Create tig state dir
14 file:
15 path: $XDG_STATE_HOME/tig
16 state: directory
17- name: Link tig state dir
18 file:
19 path: "$XDG_DATA_HOME/tig"
20 src: "$XDG_STATE_HOME/tig"
21 state: link
diff --git a/roles/git/templates/config.j2 b/roles/git/templates/config.j2
new file mode 100644
index 0000000..7182626
--- /dev/null
+++ b/roles/git/templates/config.j2
@@ -0,0 +1,23 @@
1[user]
2 signingkey = DC384748709D2619FF2867216D0CAFFDDB1CFE90
3{% if profile in role and role[profile] == "fretlink" %}
4 email = ismael.bouya@fretlink.com
5{% else %}
6 email = ismael.bouya@normalesup.org
7{% endif %}
8 name = Ismaël Bouya
9[commit]
10 gpgsign = true
11 verbose = true
12[push]
13 gpgSign = if-asked
14{% if profile in role and role[profile] == "fretlink" %}
15[fretlink]
16 remote-name = upstream
17{% endif %}
18[log]
19 showSignature = true
20{% if profile in role %}
21[init]
22 templateDir = ~/.config/git/templates_{{ role[profile] }}
23{% endif %}