diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2e5ce0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# helm ignore +charts diff --git a/.helmignore b/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/.woodpecker/helm-release.yaml b/.woodpecker/helm-release.yaml new file mode 100644 index 0000000..302e776 --- /dev/null +++ b/.woodpecker/helm-release.yaml @@ -0,0 +1,48 @@ +depends_on: + - helm-test + +when: + - event: tag + - event: pull_request + +steps: + pack-chart: + image: quay.io/helmpack/chart-releaser:v1.6.1 + commands: + - apk --no-cache add helm + - helm repo add bitnami https://charts.bitnami.com/bitnami + - mkdir -p .cr-index + - cr package chart + + release-chart: + image: quay.io/helmpack/chart-releaser:v1.6.1 + secrets: + - source: github_token + target: CR_TOKEN + commands: + - git config --global user.email "woodpecker-bot@crystalnet.org" + - git config --global user.name "woodpecker-bot" + - cr upload --skip-existing --owner CrystalNET-org --git-repo helm.crystalnet.org --release-name-template "helm-{{ .Name }}-{{ .Version }}" + - git clone https://github.com/CrystalNET-org/helm.crystalnet.org.git + - cd helm.crystalnet.org/ + - cr index --owner CrystalNET-org --git-repo helm.crystalnet.org --pages-branch main --package-path ../.cr-release-packages --index-path ../.cr-index/index.yaml --push --release-name-template "helm-{{ .Name }}-{{ .Version }}" + - cd .. + - rm -rf helm.crystalnet.org/ + - git reset --hard + when: + - event: tag + + release-chart-to-harbor: + image: harbor.crystalnet.org/dockerhub-proxy/alpine/helm:3.13.3 + secrets: + - source: harbor_helmrepo_user + target: HELMREPO_USER + - source: harbor_helmrepo_password + target: HELMREPO_PASSWORD + commands: + - helm registry login -u $${HELMREPO_USER} -p $${HELMREPO_PASSWORD} harbor.crystalnet.org/charts + - helm dependencies update chart + - helm package chart + - helm push *.tgz oci://harbor.crystalnet.org/charts + when: + - event: tag \ No newline at end of file diff --git a/.woodpecker/helm-test.yaml b/.woodpecker/helm-test.yaml new file mode 100644 index 0000000..dd27ace --- /dev/null +++ b/.woodpecker/helm-test.yaml @@ -0,0 +1,24 @@ +when: + - event: tag + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} + - event: pull_request + +steps: + lint: + image: harbor.crystalnet.org/dockerhub-proxy/alpine/helm:3.13.3 + commands: + - helm dependencies update chart + - helm lint --with-subcharts chart + + test-chart: + image: quay.io/helmpack/chart-testing:v3.10.1 + commands: + - apk --no-cache add helm + - helm repo add bitnami https://charts.bitnami.com/bitnami + # Needed for `ct` to check which chart was edited. See https://github.com/woodpecker-ci/helm/pull/56#issuecomment-1676343140 + - git fetch origin main --unshallow --no-tags || true + - git fetch origin main --no-tags || true + - git branch main origin/main || true + - ct list-changed --config ct.yaml chart + - ct lint --config ct.yaml chart diff --git a/.woodpecker/release-helper.yaml b/.woodpecker/release-helper.yaml new file mode 100644 index 0000000..b2ae230 --- /dev/null +++ b/.woodpecker/release-helper.yaml @@ -0,0 +1,16 @@ +steps: + release-helper: + image: harbor.crystalnet.org/library/plugin-ready-release-helm:1.0.3 + pull: true + settings: + release_branch: ${CI_REPO_DEFAULT_BRANCH} + forge_type: github + git_email: woodpecker-bot@crystalnet.org + github_token: + from_secret: GITHUB_TOKEN + +when: + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} + - event: manual + branch: ${CI_REPO_DEFAULT_BRANCH} \ No newline at end of file diff --git a/.woodpecker/renovate.yaml b/.woodpecker/renovate.yaml new file mode 100644 index 0000000..71d7769 --- /dev/null +++ b/.woodpecker/renovate.yaml @@ -0,0 +1,25 @@ +clone: + git: + image: harbor.crystalnet.org/dockerhub-proxy/woodpeckerci/plugin-git:2.4.0 + settings: + partial: false + depth: 1 + +steps: + renovate: + image: harbor.crystalnet.org/dockerhub-proxy/renovate/renovate:37.107.0 + secrets: + - github_com_token + - renovate_token + environment: + - RENOVATE_CONFIG_FILE=.woodpecker/renovate_config.json + - RENOVATE_DRY_RUN=false + - RENOVATE_ENDPOINT=https://api.github.com + - SHELL=/bin/bash + commands: + - LOG_LEVEL=debug renovate --ignore-pr-author true +when: + - event: cron + branch: ${CI_REPO_DEFAULT_BRANCH} + - event: manual + branch: ${CI_REPO_DEFAULT_BRANCH} \ No newline at end of file diff --git a/.woodpecker/renovate_config.json b/.woodpecker/renovate_config.json new file mode 100644 index 0000000..ea656fb --- /dev/null +++ b/.woodpecker/renovate_config.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "branchPrefix": "renovate/", + "dependencyDashboard": true, + "dependencyDashboardTitle": "Dependency Dashboard", + "gitAuthor": "Renovate Bot ", + "platform": "github", + "repositories": ["CrystalNET-org/helm-romm"] +} \ No newline at end of file