Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
HabibMAALEM committed Oct 22, 2020
0 parents commit 6bf65ac
Show file tree
Hide file tree
Showing 128 changed files with 6,284 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .ci/CHANGELOG.tpl.md
@@ -0,0 +1,24 @@
# {{ .Info.Title }}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})

{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* [`{{ .Hash.Short }}`]({{ $.Info.RepositoryURL }}/-/commit/{{ .Hash.Long }}) {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
* {{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
24 changes: 24 additions & 0 deletions .ci/git-chglog.yml
@@ -0,0 +1,24 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/groupe-edf/watchdog
options:
commits:
commit_groups:
title_maps:
ci: Continuous Integration
docs: Documentation
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
18 changes: 18 additions & 0 deletions .editorconfig
@@ -0,0 +1,18 @@
; http://editorconfig.org/

root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[{Makefile,go.mod,go.sum,*.go}]
indent_style = tab
indent_size = 2

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
* text=auto
*.go text eol=lf
18 changes: 18 additions & 0 deletions .githooks.yml
@@ -0,0 +1,18 @@
version: "1.0.0"
hooks:
- name: general
rules:
- type: commit
conditions:
- type: length
condition: lt 120
- type: pattern
condition: (?m)^(?P<type>build|ci|chore|docs|feat|fix|perf|refactor|style|test)(?P<scope>\([a-z]+\))*:\s(?P<subject>[[:word:]\s./'-]+)$
skip: Initial commit
- type: email
condition: (?m)^[a-zA-Z.\-]+@gmail.com$
ignore: true
- type: security
conditions:
- type: secret
skip: .*.json|tests/.*
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/groupe-edf/watchdog/discussions
about: Ask questions and discuss with other community members
14 changes: 14 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,14 @@
name: docs

on: push

jobs:
docs:
runs-on: ubuntu-latest
steps:
## Checks out our code locally so we can work with the files
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy documentation
run: |
echo "Checking out gh-pages branch into public"
18 changes: 18 additions & 0 deletions .github/workflows/golangci-lint.yml
@@ -0,0 +1,18 @@
name: golangci-lint

on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
## Checks out our code locally so we can work with the files
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
## Lint code
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.31
32 changes: 32 additions & 0 deletions .github/workflows/goreleaser.yml
@@ -0,0 +1,32 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
## Checks out our code locally so we can work with the files
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
## Install go based on the latest 1.15 version
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Generate CHANGELOG.md
run: |
GO111MODULE=off go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
git-chglog --config .ci/git-chglog.yml --output=CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --release-notes=CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/security.yml
@@ -0,0 +1,22 @@
name: security

on: push

jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]
name: test-${{ matrix.go-version }}
runs-on: ${{ matrix.platform }}
steps:
## Checks out our code locally so we can work with the files
- name: Checkout code
uses: actions/checkout@v2
## Run gosec security scanner
- name: Static Application Security Tools (SAST)
uses: securego/gosec@master
with:
args: -exclude=G101,G104,G204,G306,G307 -fmt=json -out=gosec.json ./...
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,30 @@
name: test

on: push

jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]
name: test-${{ matrix.go-version }}
runs-on: ${{ matrix.platform }}
steps:
## Sets up go based on the version
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
## Checks out our code locally so we can work with the files
- name: Checkout code
uses: actions/checkout@v2
## Run unit tests
- name: Unit Test
run: make test-unit
## Upload coverage reports to Codecov
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./target/coverage.txt
25 changes: 25 additions & 0 deletions .gitignore
@@ -0,0 +1,25 @@
.build
.idea
.scannerwork
.vendor
.vscode
bin
dist
node_modules
public
sonar-scanner-*
target
vendor
__debug_bin
*.test
*.log
*.out
*.prof
*.so
CHANGELOG.md
coverage.*
cucumber.json
gosec.json
package*.json
report.xml
unit-tests.xml
4 changes: 4 additions & 0 deletions .gitmodules
@@ -0,0 +1,4 @@

[submodule "docs/themes/docsy"]
path = docs/themes/docsy
url = https://github.com/google/docsy.git
27 changes: 27 additions & 0 deletions .golangci.yml
@@ -0,0 +1,27 @@
run:
tests: false

linters:
enable-all: true
disable:
- wsl
- lll
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goimports
- gomnd
- gosec
- maligned
- nestif
- nlreturn
- noctx
- scopelint
- stylecheck
42 changes: 42 additions & 0 deletions .goreleaser.yml
@@ -0,0 +1,42 @@
before:
hooks:
- make clean

builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/groupe-edf/watchdog/internal/version.Version={{.Tag}}
- -X github.com/groupe-edf/watchdog/internal/version.BuildDate={{.Date}}
- -X github.com/groupe-edf/watchdog/internal/version.Commit={{.FullCommit}}
- -X github.com/groupe-edf/watchdog/internal/version.Sha={{.ShortCommit}}
goos:
- linux
goarch:
- amd64
mod_timestamp: "{{ .CommitTimestamp }}"

changelog:
skip: true

checksum:
name_template: "{{ .ProjectName }}_checksums.txt"

nfpms:
- homepage: https://github.com/groupe-edf/watchdog
maintainer: Habib MAALEM <habib.maalem@gmail.com>
description: Git server-side Custom Hooks
vendor: watchdog
license: GPL
formats:
- apk
- deb
- rpm
empty_folders:
- /var/log/watchdog

project_name: watchdog

snapshot:
name_template: snapshot_{{ .Commit }}
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1,3 @@
* @HabibMAALEM

LICENSE @legal Habib MAALEM <habib.maalem@gmail.com>

0 comments on commit 6bf65ac

Please sign in to comment.