Skip to content

Commit

Permalink
Add release process (#47)
Browse files Browse the repository at this point in the history
* minor bash script linting fixes

* fix label indenation for linting

* bump anchore-admission-controller version

* bump chart testing & shellcheck action versions

* move html pages to gh-pages branch only

* add chart releaser action workflow

* add tarballs to gitignore

Signed-off-by: Brady Todhunter <[email protected]>
  • Loading branch information
Btodhunter authored Jul 27, 2020
1 parent 4db4fd9 commit 56d7d4e
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 71 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Charts to charts.anchore.io

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Fetch history
run: git fetch --prune --unshallow

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: stable
charts_repo_url: https://btodhunter.github.io/anchore-charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
17 changes: 12 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,31 @@ jobs:
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Fetch history
run: git fetch --prune --unshallow

- name: Shellcheck
uses: ludeeus/[email protected]
uses: ludeeus/[email protected]

- name: Run chart-testing (lint)
id: lint
uses: helm/[email protected]alpha.3
uses: helm/[email protected]rc.2
with:
command: lint
config: ct-config.yaml

- name: Install kind
uses: helm/[email protected]alpha.3
uses: helm/[email protected]rc.1
with:
node_image: "kindest/node:${{ matrix.kubernetesVersion }}"
config: kind-config.yaml
install_local_path_provisioner: true
if: steps.lint.outputs.changed == 'true'

- name: Run chart-testing (install)
uses: helm/[email protected]alpha.3
uses: helm/[email protected]rc.2
with:
command: install
config: ct-config.yaml
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea

examples/
*.tgz
26 changes: 10 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,22 @@ s3_bucket_path=$2
do_push=$3


echo Building charts in $dest_dir and merging with data from $s3_bucket_path
pushd $dest_dir
echo "Building charts in ${dest_dir} and merging with data from ${s3_bucket_path}"
pushd "${dest_dir}"

echo Syncing s3 data down
aws s3 sync s3://${s3_bucket_path} .
echo "Syncing s3 data down"
aws s3 sync s3://"${s3_bucket_path}" .

echo Generating packages
for chart_dir in $(find -maxdepth 1 -not -name '.*' -type d)
do
echo Packaging ${chart_dir}
helm package ${chart_dir}
done

find . -maxdepth 1 -not -name '.*' -type d -exec echo Packaging {} \; -exec helm package {} \;
helm repo index --merge index.yaml .


if [ "${do_push}" == "true" ]
then
echo Syncing back up
aws s3 sync ./*.tgz s3://${s3_bucket_path}
aws s3 sync ./index.yaml s3://${s3_bucket_path}
if [ "${do_push}" == "true" ]; then
echo "Syncing back up"
aws s3 sync ./*.tgz s3://"${s3_bucket_path}"
aws s3 sync ./index.yaml s3://"${s3_bucket_path}"
else
echo Skipping push
echo "Skipping push"
fi

10 changes: 0 additions & 10 deletions error.html

This file was deleted.

27 changes: 0 additions & 27 deletions index.html

This file was deleted.

2 changes: 1 addition & 1 deletion stable/anchore-admission-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: anchore-admission-controller
description: A kubernetes admission controller for validating and mutating webhooks that operates against Anchore Engine to make access decisions and annotations
apiVersion: v1
appVersion: 0.2.2
version: 0.2.8
version: 0.2.9
home: https://github.com/anchore/kubernetes-admission-controller
maintainers:
- name: zhill
Expand Down
18 changes: 9 additions & 9 deletions stable/anchore-admission-controller/files/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
ns="default"
if [ -n "${2}" ]
then
ns=${2}
ns="${2}"
fi

echo "Using ns = ${ns}"

kubectl -n ${ns} delete clusterrolebinding/extension-${1}-anchore-admission-controller-init-ca-cluster
kubectl -n ${ns} delete rolebinding/extension-${1}-anchore-admission-controller-init-ca-admin
kubectl -n ${ns} delete role/${1}-anchore-admission-controller-init-ca
kubectl -n ${ns} delete clusterrole/${1}-anchore-admission-controller-init-ca-cluster
kubectl -n ${ns} delete serviceaccount/${1}-anchore-admission-controller-init-ca
kubectl -n ${ns} delete cm/${1}-init-ca
kubectl -n ${ns} delete job/${1}-init-ca
kubectl -n "${ns}" delete clusterrolebinding/extension-"${1}"-anchore-admission-controller-init-ca-cluster
kubectl -n "${ns}" delete rolebinding/extension-"${1}"-anchore-admission-controller-init-ca-admin
kubectl -n "${ns}" delete role/"${1}"-anchore-admission-controller-init-ca
kubectl -n "${ns}" delete clusterrole/"${1}"-anchore-admission-controller-init-ca-cluster
kubectl -n "${ns}" delete serviceaccount/"${1}"-anchore-admission-controller-init-ca
kubectl -n "${ns}" delete cm/"${1}"-init-ca
kubectl -n "${ns}" delete job/"${1}"-init-ca
kubectl delete APIService/v1beta1.admission.anchore.io
kubectl -n ${ns} delete secret/${1}-anchore-admission-controller-certs
kubectl -n "${ns}" delete secret/"${1}"-anchore-admission-controller-certs
2 changes: 1 addition & 1 deletion stable/anchore-admission-controller/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: {{ template "anchore-admission-controller.name" . }}-admission.anchore.io
labels: {{- include "anchore-admission-controller.labels" . | nindent 4 }}
labels: {{- include "anchore-admission-controller.labels" . | nindent 4 }}
webhooks:
- name: {{ template "anchore-admission-controller.name" . }}-admission.anchore.io
clientConfig:
Expand Down

0 comments on commit 56d7d4e

Please sign in to comment.