chore!: Chart Publications via Github Workflow (#741)
* feat: Move Linting to Github Actions Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
parent
35c754364f
commit
9a3077afe2
18 changed files with 84 additions and 87 deletions
|
@ -5,33 +5,13 @@ jobs:
|
||||||
- image: quay.io/helmpack/chart-testing:v3.3.1
|
- image: quay.io/helmpack/chart-testing:v3.3.1
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml
|
- run: ct lint --config .github/configs/ct-lint.yaml --lint-conf .github/configs/lintconf.yaml
|
||||||
|
|
||||||
# Technically this only needs to be run on master, but it's good to have it run on every PR
|
|
||||||
# so that it is regularly tested.
|
|
||||||
publish:
|
publish:
|
||||||
docker:
|
docker:
|
||||||
# We just need an image with `helm` on it. Handily we know of one already.
|
- image: bash
|
||||||
- image: quay.io/helmpack/chart-testing:v3.3.1
|
|
||||||
steps:
|
steps:
|
||||||
# install the additional keys needed to push to GitHub. Alex Collins owns these keys.
|
- run: echo "Replaced by Github Workflow - https://github.com/argoproj/argo-helm/actions/workflows/publish.yml"
|
||||||
- add_ssh_keys
|
|
||||||
- run: git config --global user.email "nobody@circleci.com"
|
|
||||||
- run: git config --global user.name "Circle CI Build"
|
|
||||||
- checkout
|
|
||||||
- run: helm repo add stable https://charts.helm.sh/stable
|
|
||||||
- run: helm repo add minio https://helm.min.io/
|
|
||||||
- run: helm repo add argo https://argoproj.github.io/argo-helm
|
|
||||||
- run: helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
|
|
||||||
# Only actually publish charts on master.
|
|
||||||
- run: |
|
|
||||||
set -x
|
|
||||||
if [ "$CIRCLE_BRANCH" = "master" ]; then
|
|
||||||
export GIT_PUSH=true
|
|
||||||
else
|
|
||||||
export GIT_PUSH=false
|
|
||||||
fi
|
|
||||||
sh ./scripts/publish.sh
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
workflow:
|
workflow:
|
||||||
|
|
2
.github/configs/cr.yaml
vendored
Normal file
2
.github/configs/cr.yaml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
## Reference: https://github.com/helm/chart-releaser
|
||||||
|
index-path: "./index.yaml"
|
19
.github/configs/ct-install.yaml
vendored
Normal file
19
.github/configs/ct-install.yaml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
|
||||||
|
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
|
||||||
|
# Only Used for the CT Install Stage
|
||||||
|
remote: origin
|
||||||
|
chart-dirs:
|
||||||
|
- charts
|
||||||
|
chart-repos:
|
||||||
|
- argo=https://argoproj.github.io/argo-helm
|
||||||
|
- minio=https://helm.min.io/
|
||||||
|
- dandydeveloper=https://dandydeveloper.github.io/charts/
|
||||||
|
- stable=https://charts.helm.sh/stable
|
||||||
|
- incubator=https://charts.helm.sh/incubator
|
||||||
|
helm-extra-args: "--timeout 600s"
|
||||||
|
validate-chart-schema: false
|
||||||
|
validate-maintainers: true
|
||||||
|
validate-yaml: true
|
||||||
|
exclude-deprecated: true
|
||||||
|
excluded-charts:
|
||||||
|
- "argocd-applicationset"
|
|
@ -1,5 +1,6 @@
|
||||||
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
|
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
|
||||||
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
|
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
|
||||||
|
# Only Used for the CT Lint Stage
|
||||||
remote: origin
|
remote: origin
|
||||||
chart-dirs:
|
chart-dirs:
|
||||||
- charts
|
- charts
|
6
.github/workflows/lint-and-test.yml
vendored
6
.github/workflows/lint-and-test.yml
vendored
|
@ -27,19 +27,19 @@ jobs:
|
||||||
id: list-changed
|
id: list-changed
|
||||||
run: |
|
run: |
|
||||||
## If executed with debug this won't work anymore.
|
## If executed with debug this won't work anymore.
|
||||||
changed=$(ct --config ./.github/ct.yaml list-changed)
|
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
|
||||||
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
|
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
|
||||||
if [[ -n "$changed" ]]; then
|
if [[ -n "$changed" ]]; then
|
||||||
echo "::set-output name=changed::true"
|
echo "::set-output name=changed::true"
|
||||||
echo "::set-output name=changed_charts::$charts"
|
echo "::set-output name=changed_charts::$charts"
|
||||||
fi
|
fi
|
||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
run: ct lint --debug --config ./.github/ct.yaml --lint-conf ./.github/lintconf.yaml
|
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
|
||||||
|
|
||||||
- name: Create kind cluster
|
- name: Create kind cluster
|
||||||
uses: helm/kind-action@v1.1.0
|
uses: helm/kind-action@v1.1.0
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: ct install --config ./.github/ct.yaml
|
run: ct install --config ./.github/configs/ct-install.yaml
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
42
.github/workflows/publish.yml
vendored
Normal file
42
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
name: Chart Publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- rewrite-build
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
|
||||||
|
- name: Add dependency chart repos
|
||||||
|
run: |
|
||||||
|
helm repo add argo https://argoproj.github.io/argo-helm
|
||||||
|
helm repo add minio https://helm.min.io/
|
||||||
|
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
|
||||||
|
helm repo add stable https://charts.helm.sh/stable
|
||||||
|
helm repo add incubator https://charts.helm.sh/incubator
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config user.name "$GITHUB_ACTOR"
|
||||||
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||||
|
|
||||||
|
## This is required to consider the old Circle-CI Index and to stay compatible with all the old releases.
|
||||||
|
- name: Fetch current Chart Index
|
||||||
|
run: |
|
||||||
|
git checkout origin/gh-pages index.yaml
|
||||||
|
|
||||||
|
- name: Run chart-releaser
|
||||||
|
uses: helm/chart-releaser-action@v1.2.0
|
||||||
|
with:
|
||||||
|
config: "./.github/configs/cr.yaml"
|
||||||
|
env:
|
||||||
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
@ -86,7 +86,7 @@ As part of the Continuous Integration system we run Helm's [Chart Testing](https
|
||||||
|
|
||||||
The checks for this tool are stricter than the standard Helm requirements, where fields normally considered optional like `maintainer` are required in the standard spec and must be valid GitHub usernames.
|
The checks for this tool are stricter than the standard Helm requirements, where fields normally considered optional like `maintainer` are required in the standard spec and must be valid GitHub usernames.
|
||||||
|
|
||||||
Linting configuration can be found in [lintconf.yaml](.circleci/lintconf.yaml)
|
Linting configuration can be found in [ct-lint.yaml](./.github/configs/ct-lint.yaml)
|
||||||
|
|
||||||
The linting can be invoked manually with the following command:
|
The linting can be invoked manually with the following command:
|
||||||
|
|
||||||
|
@ -96,11 +96,4 @@ The linting can be invoked manually with the following command:
|
||||||
|
|
||||||
## Publishing Changes
|
## Publishing Changes
|
||||||
|
|
||||||
Changes are automatically publish whenever a commit is merged to master. The CI job (see `.circleci/config.yaml`) runs this:
|
Changes are automatically publish whenever a commit is merged to master. The CI job (see `./.github/workflows/publish.yml`).
|
||||||
|
|
||||||
```
|
|
||||||
GIT_PUSH=true ./scripts/publish.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Script generates tar file for each chart in `charts` directory and push changes to `gh-pages` branch.
|
|
||||||
Write access to https://github.com/argoproj/argo-helm.git is required to publish changes.
|
|
|
@ -1,5 +1,7 @@
|
||||||
# Argo Helm Charts
|
# Argo Helm Charts
|
||||||
|
|
||||||
|
[](https://github.com/argoproj/argo-helm/actions/workflows/publish.yml)
|
||||||
|
|
||||||
Argo Helm is a collection of **community maintained** charts for http://argoproj.io/ projects. The charts can be added using following command:
|
Argo Helm is a collection of **community maintained** charts for http://argoproj.io/ projects. The charts can be added using following command:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
appVersion: 2.0.1
|
appVersion: 2.0.1
|
||||||
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
||||||
name: argo-cd
|
name: argo-cd
|
||||||
version: 3.4.0
|
version: 3.4.1
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
description: A Helm chart to install Argo-Events in k8s Cluster
|
description: A Helm chart to install Argo-Events in k8s Cluster
|
||||||
name: argo-events
|
name: argo-events
|
||||||
version: 1.4.1
|
version: 1.4.2
|
||||||
keywords:
|
keywords:
|
||||||
- argo-events
|
- argo-events
|
||||||
- sensor-controller
|
- sensor-controller
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v1
|
||||||
appVersion: "0.10.2"
|
appVersion: "0.10.2"
|
||||||
description: A Helm chart for Argo Rollouts
|
description: A Helm chart for Argo Rollouts
|
||||||
name: argo-rollouts
|
name: argo-rollouts
|
||||||
version: 0.5.2
|
version: 0.5.3
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
maintainers:
|
maintainers:
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
name: argo-workflows
|
name: argo-workflows
|
||||||
description: A Helm chart for Argo Workflows
|
description: A Helm chart for Argo Workflows
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 0.1.1
|
||||||
appVersion: "v3.0.2"
|
appVersion: "v3.0.2"
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo-workflows/master/docs/assets/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo-workflows/master/docs/assets/argo.png
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
controller:
|
controller:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: true
|
enabled: false
|
||||||
metricsConfig:
|
metricsConfig:
|
||||||
enabled: true
|
enabled: true
|
||||||
telemetryConfig:
|
telemetryConfig:
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
name: argocd-applicationset
|
name: argocd-applicationset
|
||||||
description: A Helm chart for installing ArgoCD ApplicationSet
|
description: A Helm chart for installing ArgoCD ApplicationSet
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.4
|
version: 0.1.5
|
||||||
appVersion: "v0.1.0"
|
appVersion: "v0.1.0"
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
||||||
|
|
|
@ -3,7 +3,7 @@ appVersion: 1.1.1
|
||||||
description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD.
|
description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD.
|
||||||
name: argocd-notifications
|
name: argocd-notifications
|
||||||
type: application
|
type: application
|
||||||
version: 1.3.0
|
version: 1.3.1
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
|
|
@ -12,6 +12,6 @@ docker run \
|
||||||
quay.io/helmpack/chart-testing:v3.3.1 \
|
quay.io/helmpack/chart-testing:v3.3.1 \
|
||||||
-c cd /workdir \
|
-c cd /workdir \
|
||||||
ct lint \
|
ct lint \
|
||||||
--config .github/ct.yaml \
|
--config .github/configs/ct-lint.yaml \
|
||||||
--lint-conf .github/lintconf.yaml \
|
--lint-conf .github/configs/lintconf.yaml \
|
||||||
--debug
|
--debug
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
||||||
GIT_PUSH=${GIT_PUSH:-false}
|
|
||||||
|
|
||||||
rm -rf $SRCROOT/output && git clone -b gh-pages git@github.com:argoproj/argo-helm.git $SRCROOT/output
|
|
||||||
|
|
||||||
helm repo add argoproj https://argoproj.github.io/argo-helm
|
|
||||||
|
|
||||||
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
|
|
||||||
do
|
|
||||||
rm -rf $dir/charts
|
|
||||||
|
|
||||||
name=$(basename $dir)
|
|
||||||
|
|
||||||
if [ $(helm dep list $dir 2>/dev/null| wc -l) -gt 1 ]
|
|
||||||
then
|
|
||||||
echo "Processing chart dependencies"
|
|
||||||
helm --debug dep build $dir
|
|
||||||
# Bug with Helm subcharts with hyphen on them
|
|
||||||
# https://github.com/argoproj/argo-helm/pull/270#issuecomment-608695684
|
|
||||||
if [ "$name" == "argo-cd" ]
|
|
||||||
then
|
|
||||||
echo "Restore ArgoCD RedisHA subchart"
|
|
||||||
tar -C $dir/charts -xf $dir/charts/redis-ha-*.tgz
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Processing $dir"
|
|
||||||
helm --debug package $dir
|
|
||||||
done
|
|
||||||
|
|
||||||
cp $SRCROOT/*.tgz output/
|
|
||||||
cd $SRCROOT/output && helm repo index .
|
|
||||||
|
|
||||||
cd $SRCROOT/output && git status
|
|
||||||
|
|
||||||
if [ "$GIT_PUSH" == "true" ]
|
|
||||||
then
|
|
||||||
cd $SRCROOT/output && git add . && git commit -m "Publish charts" && git push git@github.com:argoproj/argo-helm.git gh-pages
|
|
||||||
fi
|
|
Loading…
Reference in a new issue