Skip to content

Commit ad514c9

Browse files
committed
First version
0 parents  commit ad514c9

12 files changed

+1011
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
max_line_length = 110
11+
quote_type = single
12+
13+
[*.{yaml,md,tpl,json5}]
14+
indent_size = 2
15+
16+
[Makefile]
17+
indent_style = tab

.github/ghci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=https://geoservices-int.camptocamp.com/github/schema.json
2+
3+
profile: helm

.github/renovate.json5

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
extends: ['config:base'],
3+
timezone: 'Europe/Zurich',
4+
schedule: 'after 5pm on the first day of the month',
5+
labels: ['dependencies'],
6+
separateMajorMinor: true,
7+
separateMinorPatch: true,
8+
prHourlyLimit: 0,
9+
prConcurrentLimit: 0,
10+
lockFileMaintenance: {
11+
enabled: true,
12+
automerge: true,
13+
schedule: 'after 5pm on the first day of the month',
14+
},
15+
kubernetes: {
16+
fileMatch: ['templates/.+\\.yaml$', 'tests/.*expected\\.yaml$'],
17+
},
18+
'pre-commit': { enabled: true },
19+
regexManagers: [
20+
/** Do updates on pre-commit additional dependencies */
21+
{
22+
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
23+
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
24+
},
25+
/** Do update on the schema present in the ci/config.yaml */
26+
{
27+
fileMatch: ['^ci/config\\.yaml$'],
28+
matchStrings: [
29+
'.*https://raw\\.githubusercontent\\.com/(?<depName>[^\\s]+)/(?<currentValue>[0-9\\.]+)/.*',
30+
],
31+
datasourceTemplate: 'github-tags',
32+
},
33+
],
34+
packageRules: [
35+
/** Auto merge the dev dependency update */
36+
{
37+
matchDepTypes: ['devDependencies'],
38+
automerge: true,
39+
},
40+
/** Group and auto merge the patch updates */
41+
{
42+
matchUpdateTypes: ['patch'],
43+
groupName: 'all patch versions',
44+
automerge: true,
45+
},
46+
/** Group and auto merge the minor updates */
47+
{
48+
matchUpdateTypes: ['minor'],
49+
groupName: 'all minor versions',
50+
automerge: true,
51+
},
52+
/** Support the 4 parts of shellcheck-py version with a v prefix */
53+
{
54+
versioning: 'regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)$',
55+
matchDepNames: ['shellcheck-py/shellcheck-py'],
56+
},
57+
/** Group and auto merge the CI dependencies */
58+
{
59+
matchFileNames: ['.github/**', '.pre-commit-config.yaml', 'ci/**'],
60+
groupName: 'CI dependencies',
61+
automerge: true,
62+
},
63+
],
64+
}

.github/workflows/main.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Continuous integration
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
actions: write
9+
contents: write
10+
11+
env:
12+
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
13+
14+
jobs:
15+
main:
16+
name: Continuous integration
17+
runs-on: ubuntu-22.04
18+
timeout-minutes: 20
19+
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/cache@v4
25+
with:
26+
path: ~/.cache/pre-commit
27+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
28+
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
29+
- run: pre-commit run --all-files
30+
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
31+
if: failure()
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: Apply pre-commit fix.patch
35+
path: /tmp/pre-commit.patch
36+
retention-days: 1
37+
if: failure()
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: Expected
41+
path: tests/
42+
if-no-files-found: ignore
43+
retention-days: 5
44+
if: failure()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Auto reviews, merge and close pull requests
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
9+
jobs:
10+
auto-merge:
11+
name: Auto reviews pull requests from bots
12+
runs-on: ubuntu-22.04
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: Print event
17+
run: echo "${GITHUB}" | jq
18+
env:
19+
GITHUB: ${{ toJson(github) }}
20+
- name: Print context
21+
uses: actions/github-script@v7
22+
with:
23+
script: |-
24+
console.log(context);
25+
- name: Auto reviews GHCI updates
26+
uses: actions/github-script@v7
27+
with:
28+
script: |-
29+
github.rest.pulls.createReview({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
pull_number: context.payload.pull_request.number,
33+
event: 'APPROVE',
34+
})
35+
if: |-
36+
startsWith(github.head_ref, 'ghci/audit/')
37+
&& (github.event.pull_request.user.login == 'geo-ghci-test[bot]'
38+
|| github.event.pull_request.user.login == 'geo-ghci-int[bot]'
39+
|| github.event.pull_request.user.login == 'geo-ghci[bot]')
40+
- name: Auto reviews Renovate updates
41+
uses: actions/github-script@v7
42+
with:
43+
script: |-
44+
github.rest.pulls.createReview({
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
pull_number: context.payload.pull_request.number,
48+
event: 'APPROVE',
49+
})
50+
if: |-
51+
github.event.pull_request.user.login == 'renovate[bot]'

.pre-commit-config.yaml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# https://pre-commit.com/hooks.html
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.6.0
6+
hooks:
7+
- id: detect-private-key
8+
- id: check-merge-conflict
9+
- id: check-ast
10+
- id: debug-statements
11+
- id: check-toml
12+
- id: check-yaml
13+
exclude: |-
14+
(?x)^(
15+
templates/.+\.yaml
16+
|examples/.+/templates/.+\.yaml
17+
)$
18+
args:
19+
- --allow-multiple-documents
20+
- id: check-json
21+
- id: end-of-file-fixer
22+
- id: trailing-whitespace
23+
- id: mixed-line-ending
24+
- repo: https://github.com/sbrunner/hooks
25+
rev: 1.0.0
26+
hooks:
27+
- id: copyright
28+
- repo: https://github.com/codespell-project/codespell
29+
rev: v2.3.0
30+
hooks:
31+
- id: codespell
32+
exclude: |-
33+
(?x)^(
34+
tests/expected\.yaml
35+
)$
36+
- repo: https://github.com/pre-commit/mirrors-prettier
37+
rev: v3.1.0
38+
hooks:
39+
- id: prettier
40+
exclude: |-
41+
(?x)^(
42+
tests/expected\.yaml
43+
)$
44+
- repo: https://github.com/shellcheck-py/shellcheck-py
45+
rev: v0.10.0.1
46+
hooks:
47+
- id: shellcheck
48+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
49+
rev: 3.0.0
50+
hooks:
51+
- id: git-check
52+
- repo: https://github.com/python-jsonschema/check-jsonschema
53+
rev: 0.29.2
54+
hooks:
55+
- id: check-github-workflows
56+
- id: check-jsonschema
57+
name: Check GitHub Workflows set timeout-minutes
58+
files: ^\.github/workflows/[^/]+$
59+
types:
60+
- yaml
61+
args:
62+
- --builtin-schema
63+
- github-workflows-require-timeout
64+
- repo: https://github.com/sirwart/ripsecrets
65+
rev: v0.1.8
66+
hooks:
67+
- id: ripsecrets
68+
- repo: https://github.com/camptocamp/helm-common
69+
rev: 2.0.1
70+
hooks:
71+
- id: helm-template-gen
72+
files: |-
73+
(?x)(
74+
|^values\.yaml$
75+
|^Chart\.yaml$
76+
)
77+
args:
78+
- example
79+
- .
80+
- tests/expected.yaml
81+
- repo: https://github.com/sbrunner/jsonschema-validator
82+
rev: 0.1.0
83+
hooks:
84+
- id: jsonschema-validator
85+
files: ^ci/config\.yaml$

Chart.lock

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: application
3+
repository: https://camptocamp.github.io/helm-application/
4+
version: 2.8.0
5+
digest: sha256:dff8b247e4291ae1c7ce50d4b375b9cbc87d3138a4592f566eade3c216906c4b
6+
generated: "2024-09-24T11:17:37.901999247+02:00"

Chart.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
description: A Helm chart for Mapfish Print
3+
name: mapfish-print
4+
version: 0.1.0
5+
dependencies:
6+
- name: application
7+
repository: https://camptocamp.github.io/helm-application/
8+
alias: print
9+
version: 2.8.0

LICENSE.txt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2024, Camptocamp SA
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+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
24+
The views and conclusions contained in the software and documentation are those
25+
of the authors and should not be interpreted as representing official policies,
26+
either expressed or implied, of the FreeBSD Project.

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# HELM Mapfish Print
2+
3+
This repository provide an example values file that can be used with [helm-application](https://github.com/camptocamp/helm-application) to deploy a Mapfish Print service.
4+
5+
With the following values, you will have a print with:
6+
7+
- Use a database to make the cluster mode working.
8+
- Mask the metrics views [TODO].
9+
- Expose the JMX metrics to Prometheus.
10+
- Configure a PodDisruptionBudget.
11+
- Configure an Ingress.
12+
13+
To expose the JMX metrics to Prometheus, we:
14+
15+
- Get the `jmx_prometheus_javaagent.jar` from the `bitnami/jmx-exporter` image.
16+
- Create a `jmx-exporter.yaml` configuration in a ConfigMap.
17+
- Run java with a `-javaagent:...` argument.
18+
- Configure a `prometheus` port.
19+
- Create a PodMonitor object to indicate to the Prometheus operator where he should get the metrics.

0 commit comments

Comments
 (0)