Skip to content

Commit

Permalink
[hetzner][feat] Initial Hetzner Cloud support (#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
lloesche authored Sep 14, 2024
1 parent 66cbd9e commit 90139f5
Show file tree
Hide file tree
Showing 43 changed files with 1,054 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/basecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- 'fixlib/**'
- 'plugins/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
basecheck:
name: "basecheck"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_fixlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixlib:
name: "fixlib"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_fixmetrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixmetrics:
name: "fixmetrics"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_fixshell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- 'requirements-all.txt'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixshell:
name: "fixshell"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_fixworker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixworker:
name: "fixworker"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
aws:
name: "aws"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
azure:
name: "azure"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_digitalocean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
digitalocean:
name: "digitalocean"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
dockerhub:
name: "dockerhub"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_example_collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
example_collector:
name: "example_collector"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
gcp:
name: "gcp"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
github:
name: "github"
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/check_pr_plugin_hetzner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Note: this workflow is automatically generated via the `create_pr` script in the same folder.
# Please do not change the file, but the script!

name: Check PR (Plugin hetzner)
on:
push:
tags:
- "*.*.*"
branches:
- main
pull_request:
paths:
- 'fixlib/**'
- 'plugins/hetzner/**'
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
hetzner:
name: "hetzner"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'

- name: Restore dependency cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('./plugins/hetzner/pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --editable fixlib/
pip install tox wheel flake8 build
- name: Run tests
working-directory: ./plugins/hetzner
run: tox

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: plugin-hetzner-code-coverage-report
path: ./plugins/hetzner/htmlcov/

- name: Build a binary wheel and a source tarball
working-directory: ./plugins/hetzner
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to PyPI
if: github.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_FIXINVENTORY_PLUGIN_HETZNER }}
packages_dir: ./plugins/hetzner/dist/
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
k8s:
name: "k8s"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_onelogin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
onelogin:
name: "onelogin"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_onprem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
onprem:
name: "onprem"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_posthog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
posthog:
name: "posthog"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_random.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
random:
name: "random"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_scarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
scarf:
name: "scarf"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
slack:
name: "slack"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check_pr_plugin_vsphere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
vsphere:
name: "vsphere"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
schedule:
- cron: '26 0 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/create_plugin_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
- '.github/**'
- 'requirements-all.txt'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
@name@:
name: "@name@"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- "requirements-all.txt"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
split-build:
name: "Build split Docker images" # Do not rename without updating workflow defined in publish.yml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/fixcore_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixcore-coverage:
name: "Coverage (fixcore)"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/fixcore_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixcore-lint:
name: "Lint (fixcore)"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/fixcore_test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- '.github/**'
- 'requirements-all.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
fixcore-test-and-build:
name: "Test and build (fixcore)"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/model_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
- 'requirements-all.txt'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
model:
name: "model"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.run_id }}
cancel-in-progress: true

jobs:
Expand Down
Loading

0 comments on commit 90139f5

Please sign in to comment.