forked from gadiener/ci-templates
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from jobtome-labs/feature/review-dog
Feature/review dog
- Loading branch information
Showing
21 changed files
with
101 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
lint:go: | ||
stage: lint | ||
image: cytopia/golint:latest-release-0.1 | ||
image: gadiener/golint-reviewdog:v1.0.0 | ||
variables: | ||
GITLAB_API: ${CI_API_V4_URL} | ||
script: | ||
- | | ||
echo | ||
echo "-> Linting code:" | ||
echo "-> Linting Go files:" | ||
echo | ||
golint . | ||
if [ -z "${LINT_PATH}" ]; then | ||
LINT_PATH="./..." | ||
fi | ||
if [ "${ENABLE_REVIEWDOG}" = "1" ]; then | ||
echo | ||
echo "-> Enabled Review Dog!" | ||
echo | ||
if [ -z "${REVIEWDOG_GITLAB_API_TOKEN}" ]; then | ||
echo | ||
echo "-> [WARNING] Missing 'REVIEWDOG_GITLAB_API_TOKEN' variable!" | ||
echo | ||
exit 1 | ||
fi | ||
if [ -z "${REVIEWDOG_LEVEL}" ]; then | ||
REVIEWDOG_LEVEL="warning" | ||
fi | ||
golint "${LINT_PATH}" | reviewdog -name="Go Linter" \ | ||
-f=golint -diff="git diff master" -reporter=gitlab-mr-discussion -level="${REVIEWDOG_LEVEL}" | ||
else | ||
golint "${LINT_PATH}" | ||
fi | ||
echo | ||
echo "-> Code checked!" | ||
echo "-> Go files checked!" | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,40 @@ | ||
lint:yaml: | ||
stage: lint | ||
image: cytopia/yamllint:1.18 | ||
image: gdiener/yamllint-reviewdog:v1.0.0 | ||
variables: | ||
GITLAB_API: ${CI_API_V4_URL} | ||
script: | ||
- | | ||
if [[ -z "${YAML_DIR}" ]]; then | ||
YAML_DIR="kube/" | ||
if [[ -z "${LINT_PATH}" ]]; then | ||
LINT_PATH="." | ||
fi | ||
echo | ||
echo "-> Linting manifests:" | ||
echo "-> Linting YAML files:" | ||
echo | ||
yamllint ${YAML_DIR} | ||
if [ "${ENABLE_REVIEWDOG}" = "1" ]; then | ||
echo | ||
echo "-> Enabled Review Dog!" | ||
echo | ||
if [ -z "${REVIEWDOG_GITLAB_API_TOKEN}" ]; then | ||
echo | ||
echo "-> [WARNING] Missing 'REVIEWDOG_GITLAB_API_TOKEN' variable!" | ||
echo | ||
exit 1 | ||
fi | ||
if [ -z "${REVIEWDOG_LEVEL}" ]; then | ||
REVIEWDOG_LEVEL="warning" | ||
fi | ||
yamllint --format "parsable" "${LINT_PATH}" | reviewdog -name="YAML Linter" \ | ||
-efm="%f:%l:%c: %m" -diff="git diff master" -reporter=gitlab-mr-discussion -level="${INPUT_LEVEL}" | ||
else | ||
yamllint "${LINT_PATH}" | ||
fi | ||
echo | ||
echo "-> Manifests checked!" | ||
echo "-> YAML files checked!" | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
test:terraform-security: | ||
stage: test | ||
image: linuxbandit/terraform-with-tfsec:v0.12.9 | ||
script: | ||
- | | ||
if [ -n "${TF_FOLDER_PATH}" ]; then | ||
cd "${TF_FOLDER_PATH}" | ||
fi | ||
terraform --version | ||
terraform init -backend=false | ||
tfsec . | ||
variables: | ||
GIT_DEPTH: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters