Skip to content

Commit 9787e23

Browse files
committed
Initial commit
0 parents  commit 9787e23

31 files changed

+540
-0
lines changed

.editorconfig

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.{y*ml,*json}]
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.*sonnet]
17+
# C-style doc comments
18+
block_comment_start = /*
19+
block_comment = *
20+
block_comment_end = */
21+
22+
[.gitkeep]
23+
insert_final_newline = false
24+
25+
[Makefile]
26+
indent_style = tab
27+
28+
# Don't check for trailing newlines in golden tests output
29+
[tests/golden/**]
30+
insert_final_newline = unset
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: 🐜 Bug report
3+
about: Create a report to help us improve 🔧
4+
labels: bug
5+
---
6+
7+
<!-- Place a general description or your issue here. -->
8+
9+
## Steps to Reproduce the Problem
10+
<!-- Tell us how to reproduce your issue -->
11+
12+
1.
13+
1.
14+
1.
15+
16+
## Actual Behavior
17+
<!-- What did happen as a result of the above? -->
18+
19+
## Expected Behavior
20+
<!-- What is your expectation of the result? -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: 🚀 Feature request
3+
about: Suggest an idea for this project 💡
4+
labels: enhancement
5+
---
6+
7+
## Context
8+
<!--
9+
Please let us know what you are trying to do and how you would want to do it differently?
10+
Is it something you currently cannot do?
11+
Is this related to an issue/problem?
12+
-->
13+
14+
## Alternatives
15+
<!--
16+
Can you achieve the same result doing it in an alternative way?
17+
Is the alternative considerable?
18+
-->

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: ❓ Help and Support RocketChat Channel
4+
url: https://community.appuio.ch
5+
about: Please ask and answer questions here. 🏥

.github/PULL_REQUEST_TEMPLATE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
4+
## Checklist
5+
6+
- [ ] PR contains a single logical change (to build a better changelog).
7+
- [ ] Update the documentation.
8+
- [ ] Categorize the PR by setting a good title and adding one of the labels:
9+
`bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency`
10+
as they show up in the changelog.
11+
- [ ] Link this PR to related issues or PRs.
12+
13+
<!--
14+
Thank you for your pull request. Please provide a description above and
15+
review the checklist.
16+
17+
Contributors guide: ./CONTRIBUTING.md
18+
19+
Remove items that do not apply. For completed items, change [ ] to [x].
20+
These things are not required to open a PR and can be done afterwards,
21+
while the PR is open.
22+
-->

.github/changelog-configuration.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
{
3+
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
4+
"categories": [
5+
{
6+
"title": "## 🚀 Features",
7+
"labels": ["enhancement", "feature"]
8+
},
9+
{
10+
"title": "## 🛠️ Minor Changes",
11+
"labels": ["change"]
12+
},
13+
{
14+
"title": "## 🔎 Breaking Changes",
15+
"labels": ["breaking"]
16+
},
17+
{
18+
"title": "## 🐛 Fixes",
19+
"labels": ["bug", "fix"]
20+
},
21+
{
22+
"title": "## 📄 Documentation",
23+
"labels": ["documentation"]
24+
},
25+
{
26+
"title": "## 🔗 Dependency Updates",
27+
"labels": ["dependency"]
28+
}
29+
],
30+
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}"
31+
}
32+

.github/workflows/release.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: "0"
14+
- name: Build changelog from PRs with labels
15+
id: build_changelog
16+
uses: mikepenz/release-changelog-builder-action@v3
17+
with:
18+
configuration: ".github/changelog-configuration.json"
19+
# PreReleases still get a changelog, but the next full release gets a diff since the last full release,
20+
# combining possible changelogs of all previous PreReleases in between.
21+
# PreReleases show a partial changelog since last PreRelease.
22+
ignorePreReleases: "${{ !contains(github.ref, '-rc') }}"
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Create Release
26+
uses: ncipollo/release-action@v1
27+
with:
28+
body: ${{steps.build_changelog.outputs.changelog}}
29+
prerelease: "${{ contains(github.ref, '-rc') }}"
30+
# Ensure target branch for release is "master"
31+
commit: master
32+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Pull Request
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
7+
env:
8+
COMPONENT_NAME: appcat
9+
10+
jobs:
11+
linting:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
command:
16+
- lint_jsonnet
17+
- lint_yaml
18+
- lint_adoc
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Run ${{ matrix.command }}
22+
run: make ${{ matrix.command }}
23+
editorconfig:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: snow-actions/[email protected]
28+
with:
29+
args: 'check'
30+
test:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
instance:
35+
- defaults
36+
defaults:
37+
run:
38+
working-directory: ${{ env.COMPONENT_NAME }}
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
path: ${{ env.COMPONENT_NAME }}
43+
- name: Compile component
44+
run: make test -e instance=${{ matrix.instance }}
45+
golden:
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
instance:
50+
- defaults
51+
defaults:
52+
run:
53+
working-directory: ${{ env.COMPONENT_NAME }}
54+
steps:
55+
- uses: actions/checkout@v3
56+
with:
57+
path: ${{ env.COMPONENT_NAME }}
58+
- name: Golden diff
59+
run: make golden-diff -e instance=${{ matrix.instance }}

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Commodore
2+
/.cache
3+
/dependencies
4+
/helmcharts
5+
/manifests
6+
/vendor
7+
/jsonnetfile.lock.json
8+
/crds
9+
/compiled
10+
11+
# Antora
12+
/_archive
13+
/_public
14+
15+
# Additional entries

.sync.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:global:
2+
componentName: appcat
3+
feature_goldenTests: true
4+
testMatrix:
5+
key: instance
6+
entries:
7+
- defaults
8+
9+
.github/workflows/test.yaml:
10+
test_makeTarget: test -e instance=${{ matrix.instance }}
11+
goldenTest_makeTarget: golden-diff -e instance=${{ matrix.instance }}

.yamllint.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: default
2+
3+
rules:
4+
# 80 chars should be enough, but don't fail if a line is longer
5+
line-length:
6+
max: 80
7+
level: warning
8+
9+
ignore: |
10+
dependencies/
11+
helmcharts/
12+
manifests/
13+
vendor/
14+
compiled/

CODE_OF_CONDUCT.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Code of Conduct
2+
3+
This code repository is part of Project Syn and the code of conduct at
4+
https://syn.tools/syn/about/code_of_conduct.html does apply.

CONTRIBUTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# How to contribute
2+
3+
This code repository is part of Project Syn and the contribution guide at
4+
https://syn.tools/syn/about/contribution_guide.html does apply.
5+
6+
Submit Pull Requests at https://github.com/projectsyn/component-appcat/pulls.

LICENSE

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2022, VSHN AG <[email protected]>
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of the copyright holder nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
MAKEFLAGS += --warn-undefined-variables
2+
SHELL := bash
3+
.SHELLFLAGS := -eu -o pipefail -c
4+
.DEFAULT_GOAL := all
5+
.DELETE_ON_ERROR:
6+
.SUFFIXES:
7+
8+
include Makefile.vars.mk
9+
10+
.PHONY: help
11+
help: ## Show this help
12+
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = "(: ).*?## "}; {gsub(/\\:/,":", $$1)}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
13+
14+
.PHONY: all
15+
all: lint
16+
17+
.PHONY: lint
18+
lint: lint_jsonnet lint_yaml lint_adoc lint_kubent ## All-in-one linting
19+
20+
.PHONY: lint_jsonnet
21+
lint_jsonnet: $(JSONNET_FILES) ## Lint jsonnet files
22+
$(JSONNET_DOCKER) $(JSONNETFMT_ARGS) --test -- $?
23+
24+
.PHONY: lint_yaml
25+
lint_yaml: ## Lint yaml files
26+
$(YAMLLINT_DOCKER) -f parsable -c $(YAMLLINT_CONFIG) $(YAMLLINT_ARGS) -- .
27+
28+
.PHONY: lint_adoc
29+
lint_adoc: ## Lint documentation
30+
$(VALE_CMD) $(VALE_ARGS)
31+
.PHONY: lint_kubent
32+
lint_kubent: ## Check for deprecated Kubernetes API versions
33+
$(KUBENT_DOCKER) $(KUBENT_ARGS) -f $(KUBENT_FILES)
34+
35+
.PHONY: format
36+
format: format_jsonnet ## All-in-one formatting
37+
38+
.PHONY: format_jsonnet
39+
format_jsonnet: $(JSONNET_FILES) ## Format jsonnet files
40+
$(JSONNET_DOCKER) $(JSONNETFMT_ARGS) -- $?
41+
42+
.PHONY: docs-serve
43+
docs-serve: ## Preview the documentation
44+
$(ANTORA_PREVIEW_CMD)
45+
46+
.PHONY: compile
47+
.compile:
48+
mkdir -p dependencies
49+
$(COMPILE_CMD)
50+
51+
.PHONY: test
52+
test: commodore_args += -f tests/$(instance).yml
53+
test: .compile ## Compile the component
54+
.PHONY: gen-golden
55+
gen-golden: commodore_args += -f tests/$(instance).yml
56+
gen-golden: clean .compile ## Update the reference version for target `golden-diff`.
57+
@rm -rf tests/golden/$(instance)
58+
@mkdir -p tests/golden/$(instance)
59+
@cp -R compiled/. tests/golden/$(instance)/.
60+
61+
.PHONY: golden-diff
62+
golden-diff: commodore_args += -f tests/$(instance).yml
63+
golden-diff: clean .compile ## Diff compile output against the reference version. Review output and run `make gen-golden golden-diff` if this target fails.
64+
@git diff --exit-code --minimal --no-index -- tests/golden/$(instance) compiled/
65+
66+
.PHONY: golden-diff-all
67+
golden-diff-all: recursive_target=golden-diff
68+
golden-diff-all: $(test_instances) ## Run golden-diff for all instances. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).
69+
70+
.PHONY: gen-golden-all
71+
gen-golden-all: recursive_target=gen-golden
72+
gen-golden-all: $(test_instances) ## Run gen-golden for all instances. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).
73+
74+
.PHONY: lint_kubent_all
75+
lint_kubent_all: recursive_target=lint_kubent
76+
lint_kubent_all: $(test_instances) ## Lint deprecated Kubernetes API versions for all golden test instances. Will exit on first error. Note: this doesn't work when running make with multiple parallel jobs (-j != 1).
77+
78+
.PHONY: $(test_instances)
79+
$(test_instances):
80+
$(MAKE) $(recursive_target) -e instance=$(basename $(@F))
81+
82+
.PHONY: clean
83+
clean: ## Clean the project
84+
rm -rf .cache compiled dependencies vendor helmcharts jsonnetfile*.json || true

0 commit comments

Comments
 (0)