diff options
author | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-02 17:03:49 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-02 17:03:49 +0100 |
commit | 397c4fed757d201af627636822981e85e84ea572 (patch) | |
tree | d6733d4022bf04784be84581f6c16e96a1b229e8 /roles/git | |
download | Ansible-397c4fed757d201af627636822981e85e84ea572.tar.gz Ansible-397c4fed757d201af627636822981e85e84ea572.tar.zst Ansible-397c4fed757d201af627636822981e85e84ea572.zip |
Validation initiale
Diffstat (limited to 'roles/git')
-rwxr-xr-x | roles/git/files/config_files/git/templates_fretlink/hooks/pre-push | 8 | ||||
-rw-r--r-- | roles/git/files/config_files/tig/config | 19 | ||||
-rw-r--r-- | roles/git/tasks/main.yml | 21 | ||||
-rw-r--r-- | roles/git/templates/config.j2 | 23 |
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 | |||
3 | set -e | ||
4 | |||
5 | echo "[+] Running the linter" | ||
6 | make lint | ||
7 | |||
8 | exit 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 @@ | |||
1 | set editor-line-number = yes | ||
2 | set mouse = yes | ||
3 | set mouse-scroll = 5 | ||
4 | set refresh-mode = auto | ||
5 | set line-graphics = utf-8 | ||
6 | |||
7 | set pager-view-line-number = yes,interval=10 | ||
8 | set blame-view-line-number = yes,interval=10 | ||
9 | set grep-view-line-number = yes,interval=10 | ||
10 | set diff-view-line-number = yes,interval=10 | ||
11 | set log-view-line-number = yes,interval=10 | ||
12 | set blob-view-line-number = yes,interval=10 | ||
13 | set stage-view-line-number = yes,interval=10 | ||
14 | |||
15 | set main-view-commit-title = graph=v1,refs=yes | ||
16 | set refs-view-commit-title = graph=v1,refs=yes | ||
17 | set stash-view-commit-title = graph=v1,refs=yes | ||
18 | |||
19 | set 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 %} | ||