From 27ae1e184e7bd5136acb1b6bf1007ee32ed8e9ff Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Thu, 24 Jun 2021 17:43:50 +0300 Subject: [PATCH] Scaffolding. --- .gitignore | 1 + .gitlab-ci.yml | 20 ++++++++++++++++++ .pre-commit-config.yaml | 45 +++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ go.mod | 3 +++ mnpw.go | 9 +++++++++ 6 files changed, 80 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .pre-commit-config.yaml create mode 100644 go.mod create mode 100644 mnpw.go diff --git a/.gitignore b/.gitignore index f9528a2..1f18f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ dist/ tfplan *.tfstate* *.venv +mnpw diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..153e4a1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +--- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml + +before_script: + - >- + echo 'deb http://deb.debian.org/debian buster-backports main' + >> /etc/apt/sources.list + - apt-get update + - apt-get install -y -t buster-backports golang + - go version + +build: + stage: build + image: registry.hub.docker.com/library/golang:1.16-alpine + before_script: + - go build + script: + - ./mnpw diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..328955e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,45 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: trailing-whitespace + + - repo: https://github.com/Yelp/detect-secrets + rev: v1.1.0 + hooks: + - id: detect-secrets + + - repo: https://github.com/adrienverge/yamllint + rev: v1.26.1 + hooks: + - id: yamllint + + - repo: https://github.com/amperser/proselint/ + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE + + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.7.4 + hooks: + - id: mdformat + + - repo: https://gitlab.com/devopshq/gitlab-ci-linter + rev: v1.0.3 + hooks: + - id: gitlab-ci-linter + args: + - "--server" + - https://git.shore.co.il + + - repo: https://github.com/tekwizely/pre-commit-golang.git + rev: v0.8.3 + hooks: + - id: go-fmt + - id: go-vet diff --git a/README.md b/README.md index 80720f5..f78ff85 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # My Nagios Plugin Wrapper +[](https://git.shore.co.il/shore/mnpw/-/commits/master) + ## License This software is licensed under the MIT license (see `LICENSE.txt`). diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9ee2eb2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.shore.co.il/shore/mnpw + +go 1.15 diff --git a/mnpw.go b/mnpw.go new file mode 100644 index 0000000..ec7d7b9 --- /dev/null +++ b/mnpw.go @@ -0,0 +1,9 @@ +package main + +import ( + "os" +) + +func main() { + os.Exit(0) +} -- GitLab