From 84997b98964bcdaf345bcd0fc0382f36bffc66a9 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Fri, 31 Jul 2020 10:52:10 +0200 Subject: [PATCH] Initial commit --- .github/ISSUE_TEMPLATE/01_bug_report.md | 20 ++++++++ .github/ISSUE_TEMPLATE/02_feature_request.md | 18 +++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/PULL_REQUEST_TEMPLATE.md | 21 ++++++++ .github/workflows/test.yaml | 18 +++++++ .yamllint.yml | 7 +++ CHANGELOG.md | 12 +++++ CODE_OF_CONDUCT.md | 4 ++ CONTRIBUTING.md | 6 +++ LICENSE | 27 ++++++++++ Makefile | 49 +++++++++++++++++++ README.md | 21 ++++++++ class/defaults.yml | 3 ++ class/keycloak.yml | 11 +++++ component/app.jsonnet | 10 ++++ component/main.jsonnet | 10 ++++ docs/antora.yml | 6 +++ docs/modules/ROOT/pages/explanations/.gitkeep | 0 docs/modules/ROOT/pages/how-tos/.gitkeep | 0 docs/modules/ROOT/pages/index.adoc | 3 ++ docs/modules/ROOT/pages/references/.gitkeep | 0 docs/modules/ROOT/pages/tutorials/.gitkeep | 0 docs/modules/ROOT/partials/nav.adoc | 1 + playbook.yml | 36 ++++++++++++++ postprocess/filters.yml | 1 + 25 files changed, 289 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/01_bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/02_feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/test.yaml create mode 100644 .yamllint.yml create mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 class/defaults.yml create mode 100644 class/keycloak.yml create mode 100644 component/app.jsonnet create mode 100644 component/main.jsonnet create mode 100644 docs/antora.yml create mode 100644 docs/modules/ROOT/pages/explanations/.gitkeep create mode 100644 docs/modules/ROOT/pages/how-tos/.gitkeep create mode 100644 docs/modules/ROOT/pages/index.adoc create mode 100644 docs/modules/ROOT/pages/references/.gitkeep create mode 100644 docs/modules/ROOT/pages/tutorials/.gitkeep create mode 100644 docs/modules/ROOT/partials/nav.adoc create mode 100644 playbook.yml create mode 100644 postprocess/filters.yml diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md new file mode 100644 index 00000000..f074759e --- /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 00000000..bf42f366 --- /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 00000000..ea8278c7 --- /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 00000000..7197a983 --- /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 00000000..35909d15 --- /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 00000000..addf0aa1 --- /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 00000000..a878ee90 --- /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-keycloak/compare/v0.1.0...HEAD diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..36d9baa6 --- /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 00000000..5319f9ef --- /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-keycloak/pulls. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..c38ddf16 --- /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 00000000..b98bd2f3 --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +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) + +VALE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --volume "$${PWD}"/docs/modules:/pages vshn/vale:2.1.1 +VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages + + +.PHONY: all +all: lint + +.PHONY: lint +lint: lint_jsonnet lint_yaml lint_adoc + +.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: lint_adoc +lint_adoc: + $(VALE_CMD) $(VALE_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 00000000..005fc309 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Commodore Component: keycloak + +This is a [Commodore][commodore] Component for keycloak. + +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 00000000..d68affbc --- /dev/null +++ b/class/defaults.yml @@ -0,0 +1,3 @@ +parameters: + keycloak: + namespace: syn-keycloak diff --git a/class/keycloak.yml b/class/keycloak.yml new file mode 100644 index 00000000..eba50340 --- /dev/null +++ b/class/keycloak.yml @@ -0,0 +1,11 @@ +parameters: + kapitan: + compile: + - input_paths: + - keycloak/component/app.jsonnet + input_type: jsonnet + output_path: apps/ + - input_paths: + - keycloak/component/main.jsonnet + input_type: jsonnet + output_path: keycloak/ diff --git a/component/app.jsonnet b/component/app.jsonnet new file mode 100644 index 00000000..8aa49753 --- /dev/null +++ b/component/app.jsonnet @@ -0,0 +1,10 @@ +local kap = import 'lib/kapitan.libjsonnet'; +local inv = kap.inventory(); +local params = inv.parameters.keycloak; +local argocd = import 'lib/argocd.libjsonnet'; + +local app = argocd.App('keycloak', params.namespace); + +{ + 'keycloak': app, +} diff --git a/component/main.jsonnet b/component/main.jsonnet new file mode 100644 index 00000000..cfacaf32 --- /dev/null +++ b/component/main.jsonnet @@ -0,0 +1,10 @@ +// main template for keycloak +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.keycloak; + +// Define outputs below +{ +} diff --git a/docs/antora.yml b/docs/antora.yml new file mode 100644 index 00000000..5fc1ed3d --- /dev/null +++ b/docs/antora.yml @@ -0,0 +1,6 @@ +name: keycloak +title: keycloak +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 00000000..e69de29b diff --git a/docs/modules/ROOT/pages/how-tos/.gitkeep b/docs/modules/ROOT/pages/how-tos/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc new file mode 100644 index 00000000..93a81be1 --- /dev/null +++ b/docs/modules/ROOT/pages/index.adoc @@ -0,0 +1,3 @@ += keycloak: A Commodore component to manage keycloak + +{doctitle} is a Commodore component for Managing keycloak. diff --git a/docs/modules/ROOT/pages/references/.gitkeep b/docs/modules/ROOT/pages/references/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/modules/ROOT/pages/tutorials/.gitkeep b/docs/modules/ROOT/pages/tutorials/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/modules/ROOT/partials/nav.adoc b/docs/modules/ROOT/partials/nav.adoc new file mode 100644 index 00000000..5d67faa2 --- /dev/null +++ b/docs/modules/ROOT/partials/nav.adoc @@ -0,0 +1 @@ +* xref:index.adoc[Home] diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 00000000..4498dff2 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,36 @@ +site: + title: "keycloak" + url: https://syn.tools/ + start_page: keycloak::index.adoc + robots: disallow +content: + sources: + - url: . + branches: HEAD + start_path: docs + edit_url: 'https://github.com/projectsyn/component-keycloak/edit/master/{path}' +ui: + bundle: + url: https://github.com/vshn/antora-ui-default/releases/download/1.6/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 diff --git a/postprocess/filters.yml b/postprocess/filters.yml new file mode 100644 index 00000000..316f7b87 --- /dev/null +++ b/postprocess/filters.yml @@ -0,0 +1 @@ +filters: []