From e6f8372347177a0d1ecdeaf10eb44408249107bf Mon Sep 17 00:00:00 2001 From: eclipse-diffmerge-bot <87714699+eclipse-diffmerge-bot@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:48:09 +0200 Subject: [PATCH] Initial commit --- .github/CODEOWNERS | 5 ++ .github/dependabot.yml | 13 ++++ .github/workflows/build-page.yml | 118 +++++++++++++++++++++++++++++++ README.md | 7 ++ docs/index.md | 17 +++++ docs/jsonnet/playground.jsonnet | 3 + docs/overrides/editor.html | 44 ++++++++++++ docs/overrides/main.html | 11 +++ docs/playground.md | 56 +++++++++++++++ docs/stylesheets/extra.css | 3 + mkdocs.yml | 41 +++++++++++ requirements.txt | 3 + 12 files changed, 321 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build-page.yml create mode 100644 README.md create mode 100644 docs/index.md create mode 100644 docs/jsonnet/playground.jsonnet create mode 100644 docs/overrides/editor.html create mode 100644 docs/overrides/main.html create mode 100644 docs/playground.md create mode 100644 docs/stylesheets/extra.css create mode 100644 mkdocs.yml create mode 100644 requirements.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7f8b6a1 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# The releng team is by default the owner of everything. +* @{{ org }}/eclipsefdn-releng + +# Otterdog related configurations are also owned by the security team. +/otterdog/** @{{ org }}/eclipsefdn-security diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9be4262 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + # We scan and create dependabot PRs against the develop branch only. + # Such a branch only exists for the template master at EclipseFdn/.eclipsefdn-template + # dependabot shall only update the template master, and changes will be synchronized to + # all repos by otterdog using the sync-template operation to avoid having many similar + # dependabot PRs for each individual .eclipsefdn repo which we would like to avoid at all costs. + target-branch: "develop" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/build-page.yml b/.github/workflows/build-page.yml new file mode 100644 index 0000000..563a59c --- /dev/null +++ b/.github/workflows/build-page.yml @@ -0,0 +1,118 @@ +name: Build GH Page + +on: + workflow_dispatch: + push: + branches: + - 'main' + paths: + - 'otterdog/*.jsonnet' + - 'docs/**' + - 'mkdocs.yml' + - '.github/workflows/build-page.yml' + +concurrency: + group: "pages" + cancel-in-progress: false + +permissions: + contents: read + pages: write + id-token: write + +jobs: + generate-markdown: + # do not run the workflow in the template repo itself + if: ${{ !contains (github.repository, '/.eclipsefdn-template') }} + runs-on: ubuntu-latest + steps: + - name: Checkout eclipse-csi/otterdog + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + repository: eclipse-csi/otterdog + path: otterdog + + - name: Checkout EclipseFdn/otterdog-configs + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + repository: EclipseFdn/otterdog-configs + path: otterdog-configs + + # checkout the HEAD ref + - name: Checkout HEAD + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + path: ${{ github.repository_owner }} + + - name: Install jsonnet-bundler + run: | + go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1 + echo $(go env GOPATH)/bin >> $GITHUB_PATH + + - name: Install poetry + run: pipx install poetry + + - name: Setup Python + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.10' + cache: 'poetry' + + - name: Install dependencies with poetry + run: | + poetry install --only=main + working-directory: otterdog + + - name: Copy configuration from HEAD ref + run: | + mkdir -p orgs/${{ github.repository_owner }} + cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }} + working-directory: otterdog-configs + + - name: Generate default configuration as markdown + run: ../otterdog/otterdog.sh show-default ${{ github.repository_owner }} -c otterdog.json --markdown > default.txt + working-directory: otterdog-configs + + - name: Upload generated site content + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + with: + name: generated-site + path: | + otterdog-configs/default.txt + otterdog-configs/orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet + + build-page: + runs-on: ubuntu-latest + needs: generate-markdown + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Download generated site content + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: generated-site + - shell: bash + run: | + cat default.txt >> ./docs/playground.md + cp orgs/${{ github.repository_owner }}/vendor/otterdog-defaults/*.libsonnet ./docs/jsonnet/ + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: 3.x + cache: 'pip' + - run: pip install -r requirements.txt + - name: Build with Mkdocs + run: mkdocs build + - name: Setup Pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + - name: Upload artifact + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-page + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/README.md b/README.md new file mode 100644 index 0000000..9fa84c6 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Eclipse Foundation Config Repo + +Repository to host configurations related to the Eclipse Foundation. + +## Self service of your GitHub organization + +You can find more information at . diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..0f287ee --- /dev/null +++ b/docs/index.md @@ -0,0 +1,17 @@ +--- +hide: + - navigation + - toc +--- + +# Self-service of GitHub resources + +General documentation for using the self-service (stored in directory *otterdog*) can be accessed at [otterdog.readthedocs.io](https://otterdog.readthedocs.io). + +## Current configuration + +The current configuration can be reviewed in the [Otterdog Dashboard](https://otterdog.eclipse.org/organizations/{{ org_id }}). + +## Playground + +A playground for creating and testing resources in jsonnet format is available [here](playground.md). diff --git a/docs/jsonnet/playground.jsonnet b/docs/jsonnet/playground.jsonnet new file mode 100644 index 0000000..10902f3 --- /dev/null +++ b/docs/jsonnet/playground.jsonnet @@ -0,0 +1,3 @@ +local orgs = import 'otterdog-defaults.libsonnet'; + +orgs.newRepo('myrepo') diff --git a/docs/overrides/editor.html b/docs/overrides/editor.html new file mode 100644 index 0000000..d9dab5a --- /dev/null +++ b/docs/overrides/editor.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block libs %} + {{ super() }} + + + + + + + + + + +{% endblock %} + +{% block styles %} + + + + + + + + + + + {{ super() }} + + + +{% endblock %} diff --git a/docs/overrides/main.html b/docs/overrides/main.html new file mode 100644 index 0000000..7c254cb --- /dev/null +++ b/docs/overrides/main.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block site_meta %} + {{ super() }} + + + + + + +{% endblock %} diff --git a/docs/playground.md b/docs/playground.md new file mode 100644 index 0000000..3d3381e --- /dev/null +++ b/docs/playground.md @@ -0,0 +1,56 @@ +--- +template: editor.html +hide: + - navigation + - toc +--- + +# Playground + +You can use the playground below to create and evaluate resource snippets to include in your jsonnet configuration: + +
+
+
+
+
+ + + +
+
+
+
+
output.json
+
+ +
+ +
+
+
+ +## Resource functions and default values + +The following snippets illustrate the functions to create the supported resources with default values as defined in the +[default configuration](https://github.com/EclipseFdn/otterdog-defaults/blob/main/otterdog-defaults.libsonnet) used at the Eclipse Foundation. diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..ca42bca --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,3 @@ +.md-grid { + max-width: 1440px; +} diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..e932d0c --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,41 @@ +site_name: Otterdog configuration @ {{ org }} +site_description: Otterdog configuration @ {{ org }} +strict: false + +site_url: https://{{ org }}.github.io/.eclipsefdn/ + +repo_name: {{ org }}/.eclipsefdn +repo_url: https://github.com/{{ org }}/.eclipsefdn/ + +docs_dir: ./docs +site_dir: ./_site + +theme: + name: 'material' + custom_dir: docs/overrides + features: + - navigation.tabs + +markdown_extensions: + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + - attr_list + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + +plugins: + - macros + +nav: + - Overview: index.md + - playground.md + +watch: [] + +extra: + org_id: {{ org }} + +extra_css: + - stylesheets/extra.css diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..99ae6c8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +mkdocs ~= 1.5 +mkdocs-material ~= 9.4 +mkdocs-macros-plugin ~= 1.0