Skip to content

Commit 6bf65ac

Browse files
committed
Initial commit
0 parents  commit 6bf65ac

File tree

128 files changed

+6284
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6284
-0
lines changed

.ci/CHANGELOG.tpl.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# {{ .Info.Title }}
2+
3+
{{ range .Versions }}
4+
<a name="{{ .Tag.Name }}"></a>
5+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
6+
7+
{{ range .CommitGroups -}}
8+
### {{ .Title }}
9+
10+
{{ range .Commits -}}
11+
* [`{{ .Hash.Short }}`]({{ $.Info.RepositoryURL }}/-/commit/{{ .Hash.Long }}) {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
12+
{{ end }}
13+
{{ end -}}
14+
15+
{{- if .NoteGroups -}}
16+
{{ range .NoteGroups -}}
17+
### {{ .Title }}
18+
19+
{{ range .Notes }}
20+
* {{ .Body }}
21+
{{ end }}
22+
{{ end -}}
23+
{{ end -}}
24+
{{ end -}}

.ci/git-chglog.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/groupe-edf/watchdog
6+
options:
7+
commits:
8+
commit_groups:
9+
title_maps:
10+
ci: Continuous Integration
11+
docs: Documentation
12+
feat: Features
13+
fix: Bug Fixes
14+
perf: Performance Improvements
15+
refactor: Code Refactoring
16+
header:
17+
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
18+
pattern_maps:
19+
- Type
20+
- Scope
21+
- Subject
22+
notes:
23+
keywords:
24+
- BREAKING CHANGE

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; http://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
insert_final_newline = true
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
indent_style = space
10+
indent_size = 2
11+
12+
[{Makefile,go.mod,go.sum,*.go}]
13+
indent_style = tab
14+
indent_size = 2
15+
16+
[*.md]
17+
insert_final_newline = false
18+
trim_trailing_whitespace = false

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.go text eol=lf

.githooks.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "1.0.0"
2+
hooks:
3+
- name: general
4+
rules:
5+
- type: commit
6+
conditions:
7+
- type: length
8+
condition: lt 120
9+
- type: pattern
10+
condition: (?m)^(?P<type>build|ci|chore|docs|feat|fix|perf|refactor|style|test)(?P<scope>\([a-z]+\))*:\s(?P<subject>[[:word:]\s./'-]+)$
11+
skip: Initial commit
12+
- type: email
13+
condition: (?m)^[a-zA-Z.\-][email protected]$
14+
ignore: true
15+
- type: security
16+
conditions:
17+
- type: secret
18+
skip: .*.json|tests/.*

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/groupe-edf/watchdog/discussions
5+
about: Ask questions and discuss with other community members

.github/workflows/docs.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: docs
2+
3+
on: push
4+
5+
jobs:
6+
docs:
7+
runs-on: ubuntu-latest
8+
steps:
9+
## Checks out our code locally so we can work with the files
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
- name: Deploy documentation
13+
run: |
14+
echo "Checking out gh-pages branch into public"

.github/workflows/golangci-lint.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: golangci-lint
2+
3+
on: push
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
## Checks out our code locally so we can work with the files
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
## Lint code
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v2
17+
with:
18+
version: v1.31

.github/workflows/goreleaser.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
## Checks out our code locally so we can work with the files
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
## Install go based on the latest 1.15 version
18+
- name: Install Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.15.x
22+
- name: Generate CHANGELOG.md
23+
run: |
24+
GO111MODULE=off go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
25+
git-chglog --config .ci/git-chglog.yml --output=CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v2
28+
with:
29+
version: latest
30+
args: release --rm-dist --release-notes=CHANGELOG.md
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/security.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: security
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
go-version: [1.15.x]
11+
platform: [ubuntu-latest]
12+
name: test-${{ matrix.go-version }}
13+
runs-on: ${{ matrix.platform }}
14+
steps:
15+
## Checks out our code locally so we can work with the files
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
## Run gosec security scanner
19+
- name: Static Application Security Tools (SAST)
20+
uses: securego/gosec@master
21+
with:
22+
args: -exclude=G101,G104,G204,G306,G307 -fmt=json -out=gosec.json ./...

.github/workflows/test.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: test
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
go-version: [1.15.x]
11+
platform: [ubuntu-latest]
12+
name: test-${{ matrix.go-version }}
13+
runs-on: ${{ matrix.platform }}
14+
steps:
15+
## Sets up go based on the version
16+
- name: Install Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: ${{ matrix.go-version }}
20+
## Checks out our code locally so we can work with the files
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
## Run unit tests
24+
- name: Unit Test
25+
run: make test-unit
26+
## Upload coverage reports to Codecov
27+
- uses: codecov/codecov-action@v1
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
file: ./target/coverage.txt

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.build
2+
.idea
3+
.scannerwork
4+
.vendor
5+
.vscode
6+
bin
7+
dist
8+
node_modules
9+
public
10+
sonar-scanner-*
11+
target
12+
vendor
13+
__debug_bin
14+
*.test
15+
*.log
16+
*.out
17+
*.prof
18+
*.so
19+
CHANGELOG.md
20+
coverage.*
21+
cucumber.json
22+
gosec.json
23+
package*.json
24+
report.xml
25+
unit-tests.xml

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[submodule "docs/themes/docsy"]
3+
path = docs/themes/docsy
4+
url = https://github.com/google/docsy.git

.golangci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
run:
2+
tests: false
3+
4+
linters:
5+
enable-all: true
6+
disable:
7+
- wsl
8+
- lll
9+
- funlen
10+
- gci
11+
- gochecknoglobals
12+
- gochecknoinits
13+
- gocognit
14+
- godot
15+
- godox
16+
- goerr113
17+
- gofmt
18+
- gofumpt
19+
- goimports
20+
- gomnd
21+
- gosec
22+
- maligned
23+
- nestif
24+
- nlreturn
25+
- noctx
26+
- scopelint
27+
- stylecheck

.goreleaser.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
before:
2+
hooks:
3+
- make clean
4+
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
ldflags:
9+
- -s -w
10+
- -X github.com/groupe-edf/watchdog/internal/version.Version={{.Tag}}
11+
- -X github.com/groupe-edf/watchdog/internal/version.BuildDate={{.Date}}
12+
- -X github.com/groupe-edf/watchdog/internal/version.Commit={{.FullCommit}}
13+
- -X github.com/groupe-edf/watchdog/internal/version.Sha={{.ShortCommit}}
14+
goos:
15+
- linux
16+
goarch:
17+
- amd64
18+
mod_timestamp: "{{ .CommitTimestamp }}"
19+
20+
changelog:
21+
skip: true
22+
23+
checksum:
24+
name_template: "{{ .ProjectName }}_checksums.txt"
25+
26+
nfpms:
27+
- homepage: https://github.com/groupe-edf/watchdog
28+
maintainer: Habib MAALEM <[email protected]>
29+
description: Git server-side Custom Hooks
30+
vendor: watchdog
31+
license: GPL
32+
formats:
33+
- apk
34+
- deb
35+
- rpm
36+
empty_folders:
37+
- /var/log/watchdog
38+
39+
project_name: watchdog
40+
41+
snapshot:
42+
name_template: snapshot_{{ .Commit }}

CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* @HabibMAALEM
2+
3+
LICENSE @legal Habib MAALEM <[email protected]>

0 commit comments

Comments
 (0)