Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from adampeklay/aws-s3-private-helm-repo-support
Browse files Browse the repository at this point in the history
Add AWS S3 repo support
  • Loading branch information
stefanprodan committed Apr 29, 2020
2 parents 51d3e0e + e5c7dd5 commit 8b04204
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,32 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
```
If you set `awsS3Repo: true`, make sure you set the appropriate environment variables for helm s3 plugin to work. Example:
```yaml
name: CI
on: [push, pull_request]
jobs:
hrval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Validate Helm Releases in test dir
uses: stefanprodan/hrval-action@v3.1.0
with:
helmRelease: test/
awsS3Repo: true
awsS3RepoName: example-s3-helm-repo
awsS3Plugin: https://github.com/hypnoglow/helm-s3.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
```

Gitlab CI Token is also possible using `GITLAB_CI_TOKEN`.

## CI alternatives
Expand Down
12 changes: 12 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ inputs:
helmVersion:
description: 'Version of Helm to validate against'
default: 'v2'
awsS3Repo:
description: '(Optional) Set to true if using an AWS S3 Helm Repo'
default: false
awsS3RepoName:
description: '(Optional) The name of the AWS S3 Helm repo, if awsS3Repo was set to true'
default: ''
awsS3Plugin:
description: '(Optional) AWS S3 Plugin to be used in the helm plugin install command'
default: ''
outputs:
numFilesTested:
description: The number of HelmRelease files which were tested
Expand All @@ -29,3 +38,6 @@ runs:
- ${{ inputs.ignoreValues }}
- ${{ inputs.kubernetesVersion }}
- ${{ inputs.helmVersion }}
- ${{ inputs.awsS3Repo }}
- ${{ inputs.awsS3RepoName }}
- ${{ inputs.awsS3RepoPlugin }}
9 changes: 9 additions & 0 deletions src/hrval-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ IGNORE_VALUES=${2-false}
KUBE_VER=${3-master}
HELM_VER=${4-v2}
HRVAL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/hrval.sh"
AWS_S3_REPO=${5-false}
AWS_S3_REPO_NAME=${6-""}
AWS_S3_PLUGIN={$7-""}

if [[ ${HELM_VER} == "v2" ]]; then
helm init --client-only
fi

if [[ ${AWS_S3_REPO} == true ]]; then
helm plugin install ${AWS_S3_PLUGIN}
helm repo add ${AWS_S3_REPO_NAME} s3:/${AWS_S3_REPO_NAME}/charts
helm repo update
fi

# If the path provided is actually a file, just run hrval against this one file
if test -f "${DIR}"; then
${HRVAL} ${DIR} ${IGNORE_VALUES} ${KUBE_VER} ${HELM_VER}
Expand Down

0 comments on commit 8b04204

Please sign in to comment.