Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting for K8s files #18

Merged
merged 1 commit into from
Mar 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---

# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: kubernetes


# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Runs on Pull Requests
pull_request:

# Runs on master Branch and Tags
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+*'


# -------------------------------------------------------------------------------------------------
# What to run
# -------------------------------------------------------------------------------------------------
jobs:
kubernetes:
name: Kubernetes
runs-on: ubuntu-latest
steps:

# ------------------------------------------------------------
# Checkout repository
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

# ------------------------------------------------------------
# Tests
# ------------------------------------------------------------
- name: Lint K8s files
shell: bash
run: |
cd k8s/
make lint
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ For more information see [Terraform module](aws/).

### Kubernetes

[![Kubernetes](https://github.com/cytopia/docker-dvwa/actions/workflows/kubernetes.yml/badge.svg)](https://github.com/cytopia/docker-dvwa/actions/workflows/kubernetes.yml)

This repository ships Kubernetes deployments to run DVWA on K8s or minikube.

```bash
Expand Down
16 changes: 16 additions & 0 deletions k8s/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ifneq (,)
.error This Makefile requires GNU Make.
endif

.PHONY: help lint_lint_files _lint_k8s _pull-tf _pull-tf-docs

CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

help:
@echo "lint Static source code analysis"

lint:
@$(MAKE) --no-print-directory _lint_k8s

_lint_k8s:
docker run --rm -v $(CURRENT_DIR):/data cytopia/kubeval *.yml