Skip to content

Commit 03a8282

Browse files
Initial commit
0 parents  commit 03a8282

12 files changed

+321
-0
lines changed

.github/CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The releng team is by default the owner of everything.
2+
* @{{ org }}/eclipsefdn-releng
3+
4+
# Otterdog related configurations are also owned by the security team.
5+
/otterdog/** @{{ org }}/eclipsefdn-security

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
# We scan and create dependabot PRs against the develop branch only.
6+
# Such a branch only exists for the template master at EclipseFdn/.eclipsefdn-template
7+
# dependabot shall only update the template master, and changes will be synchronized to
8+
# all repos by otterdog using the sync-template operation to avoid having many similar
9+
# dependabot PRs for each individual .eclipsefdn repo which we would like to avoid at all costs.
10+
target-branch: "develop"
11+
schedule:
12+
interval: daily
13+
open-pull-requests-limit: 10

.github/workflows/build-page.yml

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build GH Page
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'main'
8+
paths:
9+
- 'otterdog/*.jsonnet'
10+
- 'docs/**'
11+
- 'mkdocs.yml'
12+
- '.github/workflows/build-page.yml'
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
jobs:
24+
generate-markdown:
25+
# do not run the workflow in the template repo itself
26+
if: ${{ !contains (github.repository, '/.eclipsefdn-template') }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout eclipse-csi/otterdog
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
repository: eclipse-csi/otterdog
33+
path: otterdog
34+
35+
- name: Checkout EclipseFdn/otterdog-configs
36+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
with:
38+
repository: EclipseFdn/otterdog-configs
39+
path: otterdog-configs
40+
41+
# checkout the HEAD ref
42+
- name: Checkout HEAD
43+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
44+
with:
45+
path: ${{ github.repository_owner }}
46+
47+
- name: Install jsonnet-bundler
48+
run: |
49+
go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
50+
echo $(go env GOPATH)/bin >> $GITHUB_PATH
51+
52+
- name: Install poetry
53+
run: pipx install poetry
54+
55+
- name: Setup Python
56+
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
57+
with:
58+
python-version: '3.10'
59+
cache: 'poetry'
60+
61+
- name: Install dependencies with poetry
62+
run: |
63+
poetry install --only=main
64+
working-directory: otterdog
65+
66+
- name: Copy configuration from HEAD ref
67+
run: |
68+
mkdir -p orgs/${{ github.repository_owner }}
69+
cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }}
70+
working-directory: otterdog-configs
71+
72+
- name: Generate default configuration as markdown
73+
run: ../otterdog/otterdog.sh show-default ${{ github.repository_owner }} -c otterdog.json --markdown > default.txt
74+
working-directory: otterdog-configs
75+
76+
- name: Upload generated site content
77+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
78+
with:
79+
name: generated-site
80+
path: |
81+
otterdog-configs/default.txt
82+
otterdog-configs/orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet
83+
84+
build-page:
85+
runs-on: ubuntu-latest
86+
needs: generate-markdown
87+
steps:
88+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
89+
- name: Download generated site content
90+
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
91+
with:
92+
name: generated-site
93+
- shell: bash
94+
run: |
95+
cat default.txt >> ./docs/playground.md
96+
cp orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet ./docs/jsonnet/
97+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
98+
with:
99+
python-version: 3.x
100+
cache: 'pip'
101+
- run: pip install -r requirements.txt
102+
- name: Build with Mkdocs
103+
run: mkdocs build
104+
- name: Setup Pages
105+
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
106+
- name: Upload artifact
107+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
108+
109+
deploy:
110+
environment:
111+
name: github-pages
112+
url: ${{ steps.deployment.outputs.page_url }}
113+
runs-on: ubuntu-latest
114+
needs: build-page
115+
steps:
116+
- name: Deploy to GitHub Pages
117+
id: deployment
118+
uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 # v4.0.4

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Eclipse Foundation Config Repo
2+
3+
Repository to host configurations related to the Eclipse Foundation.
4+
5+
## Self service of your GitHub organization
6+
7+
You can find more information at <https://{{ org }}.github.io/.eclipsefdn/>.

docs/index.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
hide:
3+
- navigation
4+
- toc
5+
---
6+
7+
# Self-service of GitHub resources
8+
9+
General documentation for using the self-service (stored in directory *otterdog*) can be accessed at [otterdog.readthedocs.io](https://otterdog.readthedocs.io).
10+
11+
## Current configuration
12+
13+
The current configuration can be reviewed in the [Otterdog Dashboard](https://otterdog.eclipse.org/organizations/{{ org_id }}).
14+
15+
## Playground
16+
17+
A playground for creating and testing resources in jsonnet format is available [here](playground.md).

docs/jsonnet/playground.jsonnet

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
local orgs = import 'otterdog-defaults.libsonnet';
2+
3+
orgs.newRepo('myrepo')

docs/overrides/editor.html

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% extends "base.html" %}
2+
3+
{% block libs %}
4+
{{ super() }}
5+
<script src="https://eclipsefdn.github.io/otterdog-assets/third_party/js-yaml/dist/js-yaml.min.js"></script>
6+
<script src="https://eclipsefdn.github.io/otterdog-assets/third_party/CodeMirror/lib/codemirror.js"></script>
7+
<script src="https://eclipsefdn.github.io/otterdog-assets/third_party/CodeMirror/mode/yaml/yaml.js"></script>
8+
<script src="https://eclipsefdn.github.io/otterdog-assets/third_party/CodeMirror/addon/edit/matchbrackets.js"></script>
9+
<script src="https://eclipsefdn.github.io/otterdog-assets/js/codemirror-mode-jsonnet.js"></script>
10+
11+
<!-- Executing Jsonnet -->
12+
<script src="https://eclipsefdn.github.io/otterdog-assets/js/wasm_exec.js"></script>
13+
<script>
14+
if (!WebAssembly.instantiateStreaming) {
15+
// This function was observed to be missing on Safari 14.
16+
WebAssembly.instantiateStreaming = async (resp, importObject) => {
17+
const source = await (await resp).arrayBuffer();
18+
return await WebAssembly.instantiate(source, importObject);
19+
};
20+
}
21+
const go = new Go();
22+
WebAssembly.instantiateStreaming(fetch("https://eclipsefdn.github.io/otterdog-assets/js/libjsonnet.wasm"), go.importObject).then((result) => {
23+
go.run(result.instance);
24+
});
25+
</script>
26+
<script src="https://eclipsefdn.github.io/otterdog-assets/js/demo.js"></script>
27+
{% endblock %}
28+
29+
{% block styles %}
30+
<!-- Google Fonts -->
31+
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,600,700" rel="stylesheet" type="text/css">
32+
33+
<!-- jsonnet.org stylesheet -->
34+
<link rel="stylesheet" type="text/css" href="https://eclipsefdn.github.io/otterdog-assets/css/doc.css" />
35+
<link rel="stylesheet" media="print" href="https://eclipsefdn.github.io/otterdog-assets/css/desktop.css">
36+
<!-- The extra 16px is to account for the scrollbar, which is not always included. -->
37+
<link rel="stylesheet" media="screen and (min-width: 1296px)" href="https://eclipsefdn.github.io/otterdog-assets/css/desktop.css">
38+
<link rel="stylesheet" media="screen and (max-width: 1295px) and (min-width: 720px)" href="https://eclipsefdn.github.io/otterdog-assets/css/cellphone.css">
39+
<link rel="stylesheet" media="screen and (max-width: 719px)" href="https://eclipsefdn.github.io/otterdog-assets/css/cellphone-small.css">
40+
{{ super() }}
41+
42+
<!-- CodeMirror -->
43+
<link rel="stylesheet" href="https://eclipsefdn.github.io/otterdog-assets/third_party/CodeMirror/lib/codemirror.css">
44+
{% endblock %}

docs/overrides/main.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "base.html" %}
2+
3+
{% block site_meta %}
4+
{{ super() }}
5+
<!-- prevent caching -->
6+
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
7+
<meta http-equiv="cache-control" content="max-age=0" />
8+
<meta http-equiv="expires" content="0" />
9+
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
10+
<meta http-equiv="pragma" content="no-cache" />
11+
{% endblock %}

docs/playground.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
template: editor.html
3+
hide:
4+
- navigation
5+
- toc
6+
---
7+
8+
# Playground
9+
10+
You can use the playground below to create and evaluate resource snippets to include in your jsonnet configuration:
11+
12+
<div class="inverse hgroup">
13+
<div class=hgroup-inline>
14+
<div class="tab-window-input" id="input">
15+
<div class="tab-header">
16+
</div>
17+
<textarea id=playground-jsonnet>
18+
{% include 'jsonnet/playground.jsonnet' %}
19+
</textarea>
20+
<textarea id=otterdog-defaults-libsonnet>
21+
{% include 'jsonnet/otterdog-defaults.libsonnet' %}
22+
</textarea>
23+
<textarea id=otterdog-functions-libsonnet>
24+
{% include 'jsonnet/otterdog-functions.libsonnet' %}
25+
</textarea>
26+
</div>
27+
<div class="bigarrow">➡</div>
28+
<div class="tab-window-output" id="output">
29+
<div class="tab-header">
30+
<div class=selected onclick="tab_output_click(this, 'json-output')">output.json</div>
31+
</div>
32+
<textarea readonly class="selected code-json" id="json-output">
33+
</textarea>
34+
</div>
35+
<script>
36+
demo(
37+
'input',
38+
{
39+
'playground-jsonnet': 'playground.jsonnet',
40+
'otterdog-defaults-libsonnet': 'otterdog-defaults.libsonnet',
41+
'otterdog-functions-libsonnet': 'otterdog-functions.libsonnet'
42+
},
43+
'playground.jsonnet',
44+
'output',
45+
false,
46+
false
47+
);
48+
</script>
49+
<div style="clear: both"></div>
50+
</div>
51+
</div>
52+
53+
## Resource functions and default values
54+
55+
The following snippets illustrate the functions to create the supported resources with default values as defined in the
56+
[default configuration](https://github.com/EclipseFdn/otterdog-defaults/blob/main/otterdog-defaults.libsonnet) used at the Eclipse Foundation.

docs/stylesheets/extra.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.md-grid {
2+
max-width: 1440px;
3+
}

mkdocs.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
site_name: Otterdog configuration @ {{ org }}
2+
site_description: Otterdog configuration @ {{ org }}
3+
strict: false
4+
5+
site_url: https://{{ org }}.github.io/.eclipsefdn/
6+
7+
repo_name: {{ org }}/.eclipsefdn
8+
repo_url: https://github.com/{{ org }}/.eclipsefdn/
9+
10+
docs_dir: ./docs
11+
site_dir: ./_site
12+
13+
theme:
14+
name: 'material'
15+
custom_dir: docs/overrides
16+
features:
17+
- navigation.tabs
18+
19+
markdown_extensions:
20+
- pymdownx.superfences
21+
- pymdownx.tabbed:
22+
alternate_style: true
23+
- attr_list
24+
- pymdownx.emoji:
25+
emoji_index: !!python/name:materialx.emoji.twemoji
26+
emoji_generator: !!python/name:materialx.emoji.to_svg
27+
28+
plugins:
29+
- macros
30+
31+
nav:
32+
- Overview: index.md
33+
- playground.md
34+
35+
watch: []
36+
37+
extra:
38+
org_id: {{ org }}
39+
40+
extra_css:
41+
- stylesheets/extra.css

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mkdocs ~= 1.5
2+
mkdocs-material ~= 9.4
3+
mkdocs-macros-plugin ~= 1.0

0 commit comments

Comments
 (0)