diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md new file mode 100644 index 0000000..f074759 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -0,0 +1,20 @@ +--- +name: 🐜 Bug report +about: Create a report to help us improve 🔧 +labels: bug +--- + + + +## Steps to Reproduce the Problem + + + 1. + 1. + 1. + +## Actual Behavior + + +## Expected Behavior + diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.md b/.github/ISSUE_TEMPLATE/02_feature_request.md new file mode 100644 index 0000000..bf42f36 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature_request.md @@ -0,0 +1,18 @@ +--- +name: 🚀 Feature request +about: Suggest an idea for this project 💡 +labels: enhancement +--- + +## Context + + +## Alternatives + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ea8278c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ❓ Help and Support RocketChat Channel + url: https://community.appuio.ch + about: Please ask and answer questions here. 🏥 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7197a98 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ + + +## Checklist + + +- [ ] Keep pull requests small so they can be easily reviewed. +- [ ] Update the documentation. +- [ ] Update the ./CHANGELOG.md. +- [ ] Link this PR to related issues. + + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..35909d1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,18 @@ +name: Pull Request +on: + pull_request: + branches: + - master + +jobs: + linting: + runs-on: ubuntu-latest + strategy: + matrix: + command: + - lint_jsonnet + - lint_yaml + steps: + - uses: actions/checkout@v2 + - name: Run ${{ matrix.command }} + run: make ${{ matrix.command }} diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..addf0aa --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,7 @@ +extends: default + +rules: + # 80 chars should be enough, but don't fail if a line is longer + line-length: + max: 80 + level: warning diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8fe1108 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added + +- … + +[Unreleased]: https://github.com/projectsyn/component-storage-class/compare/v0.1.0...HEAD diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..36d9baa --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,4 @@ +# Code of Conduct + +This code repository is part of Project Syn and the code of conduct at +https://syn.tools/syn/code_of_conduct.html does apply. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6bf0a9c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,6 @@ +# How to contribute + +This code repository is part of Project Syn and the contribution guide at +https://syn.tools/syn/contribution_guide.html does apply. + +Submit Pull Requests at https://github.com/projectsyn/component-storage-class/pulls. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c38ddf1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright 2020, VSHN AG +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d12337e --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +MAKEFLAGS += --warn-undefined-variables +SHELL := bash +.SHELLFLAGS := -eu -o pipefail -c +.DEFAULT_GOAL := all +.DELETE_ON_ERROR: +.SUFFIXES: + +DOCKER_CMD ?= docker +DOCKER_ARGS ?= run --rm --user "$$(id -u)" -v "$${PWD}:/component" --workdir /component + +JSONNET_FILES ?= $(shell find . -type f -name '*.*jsonnet' -or -name '*.libsonnet') +JSONNETFMT_ARGS ?= --in-place +JSONNET_IMAGE ?= docker.io/bitnami/jsonnet:latest +JSONNET_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) --entrypoint=jsonnetfmt $(JSONNET_IMAGE) + +YAML_FILES ?= $(shell find . -type f -name '*.yaml' -or -name '*.yml') +YAMLLINT_ARGS ?= --no-warnings +YAMLLINT_CONFIG ?= .yamllint.yml +YAMLLINT_IMAGE ?= docker.io/cytopia/yamllint:latest +YAMLLINT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(YAMLLINT_IMAGE) + +.PHONY: all +all: lint + +.PHONY: lint +lint: lint_jsonnet lint_yaml + +.PHONY: lint_jsonnet +lint_jsonnet: $(JSONNET_FILES) + $(JSONNET_DOCKER) $(JSONNETFMT_ARGS) --test -- $? + +.PHONY: lint_yaml +lint_yaml: $(YAML_FILES) + $(YAMLLINT_DOCKER) -f parsable -c $(YAMLLINT_CONFIG) $(YAMLLINT_ARGS) -- $? + +.PHONY: format +format: format_jsonnet + +.PHONY: format_jsonnet +format_jsonnet: $(JSONNET_FILES) + $(JSONNET_DOCKER) $(JSONNETFMT_ARGS) -- $? diff --git a/README.md b/README.md new file mode 100644 index 0000000..6413a01 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Commodore Component: StorageClass + +This is a [Commodore][commodore] Component to manage https://kubernetes.io/docs/concepts/storage/storage-classes[StorageClass] objects on a cluster. + +This repository is part of Project Syn. +For documentation on Project Syn and this component, see https://syn.tools. + +## Documentation + +Documentation for this component is written using [Asciidoc][asciidoc] and [Antora][antora]. +It is located in the [docs/](docs) folder. +The [Divio documentation structure](https://documentation.divio.com/) is used to organize its content. + +## Contributing and license + +This library is licensed under [BSD-3-Clause](LICENSE). +For information about how to contribute see [CONTRIBUTING](CONTRIBUTING.md). + +[commodore]: https://docs.syn.tools/commodore/index.html +[asciidoc]: https://asciidoctor.org/ +[antora]: https://antora.org/ diff --git a/class/defaults.yml b/class/defaults.yml new file mode 100644 index 0000000..3f4abbf --- /dev/null +++ b/class/defaults.yml @@ -0,0 +1,2 @@ +parameters: + storage_class: diff --git a/class/storage-class.yml b/class/storage-class.yml new file mode 100644 index 0000000..0681c9c --- /dev/null +++ b/class/storage-class.yml @@ -0,0 +1,11 @@ +parameters: + kapitan: + compile: + - input_paths: + - storage-class/component/app.jsonnet + input_type: jsonnet + output_path: apps/ + - input_paths: + - storage-class/component/main.jsonnet + input_type: jsonnet + output_path: storage-class/ diff --git a/component/app.jsonnet b/component/app.jsonnet new file mode 100644 index 0000000..fa96b16 --- /dev/null +++ b/component/app.jsonnet @@ -0,0 +1,7 @@ +local argocd = import 'lib/argocd.libjsonnet'; + +local app = argocd.App('storage-class', 'syn'); + +{ + 'storage-class': app, +} diff --git a/component/main.jsonnet b/component/main.jsonnet new file mode 100644 index 0000000..0d6cc0e --- /dev/null +++ b/component/main.jsonnet @@ -0,0 +1,10 @@ +// main template for storage-class +local kap = import 'lib/kapitan.libjsonnet'; +local kube = import 'lib/kube.libjsonnet'; +local inv = kap.inventory(); +// The hiera parameters for the component +local params = inv.parameters.storage_class; + +// Define outputs below +{ +} diff --git a/docs/antora.yml b/docs/antora.yml new file mode 100644 index 0000000..4f22ee0 --- /dev/null +++ b/docs/antora.yml @@ -0,0 +1,6 @@ +name: storage-class +title: StorageClass +version: master +start_page: ROOT:index.adoc +nav: + - modules/ROOT/partials/nav.adoc diff --git a/docs/modules/ROOT/pages/explanations/.gitkeep b/docs/modules/ROOT/pages/explanations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/modules/ROOT/pages/how-tos/.gitkeep b/docs/modules/ROOT/pages/how-tos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..bba7fca --- /dev/null +++ b/docs/modules/ROOT/pages/index.adoc @@ -0,0 +1,3 @@ += Component StorageClass + +{doctitle} is a Commodore Component to manage https://kubernetes.io/docs/concepts/storage/storage-classes[StorageClass] objects on a cluster. diff --git a/docs/modules/ROOT/pages/references/.gitkeep b/docs/modules/ROOT/pages/references/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/modules/ROOT/pages/tutorials/.gitkeep b/docs/modules/ROOT/pages/tutorials/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/modules/ROOT/partials/nav.adoc b/docs/modules/ROOT/partials/nav.adoc new file mode 100644 index 0000000..5d67faa --- /dev/null +++ b/docs/modules/ROOT/partials/nav.adoc @@ -0,0 +1 @@ +* xref:index.adoc[Home] diff --git a/lib/storage-class.libjsonnet b/lib/storage-class.libjsonnet new file mode 100644 index 0000000..e6dbfbf --- /dev/null +++ b/lib/storage-class.libjsonnet @@ -0,0 +1,10 @@ +/** + * \file Library helpers to create StorageClass objects. + */ + +local kap = import 'lib/kapitan.libjsonnet'; +local kube = import 'lib/kube.libjsonnet'; + +// Export library functions here +{ +} diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..38a8f37 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,36 @@ +site: + title: StorageClass + url: https://syn.tools/ + start_page: storage-class::index.adoc + robots: disallow +content: + sources: + - url: . + branches: HEAD + start_path: docs + edit_url: 'https://github.com/projectsyn/component-storage-class/edit/master/{path}' +ui: + bundle: + url: https://github.com/projectsyn/antora-ui-default/releases/download/1.3/ui-bundle.zip + snapshot: false +asciidoc: + attributes: + toc: 'auto' + toc-title: '' + toclevels: 2 + hide-uri-scheme: '' + experimental: '' + stem: '' + icons: font + kroki-server-url: https://vshn-kroki.appuioapp.ch + kroki-fetch-diagram: '' + extensions: + - asciidoctor-kroki +output: + destinations: + - provider: fs + path: ./_public + clean: true + - provider: archive + path: ./_archive/site.zip + clean: true