Skip to content

Commit 9f628de

Browse files
Merge pull request #67 from abnamro/1968266-ChartReleaserAction
[#1968266] Added new action in the workflows that allows Helm Charts to be released
2 parents ee7444f + 83a8524 commit 9f628de

File tree

3 files changed

+45
-11
lines changed

3 files changed

+45
-11
lines changed

.github/workflows/k8-infra-ci.yaml

+29-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [ "main" ]
1111
paths:
1212
- .github/workflows/k8-infra-ci.yaml
13-
- components/kubernetes/**
13+
- deployment/kubernetes/**
1414

1515
env:
1616
KUBERNETES_INFRA_DIR: deployment/kubernetes
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout Repository
2525
uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Set up Helm
2830
uses: azure/setup-helm@v3
@@ -64,4 +66,29 @@ jobs:
6466
quiet: true
6567
soft_fail: true
6668
output_format: json
67-
69+
70+
release-charts:
71+
name: Release Charts
72+
permissions:
73+
contents: write
74+
runs-on: ubuntu-latest
75+
needs: helm-chart-validation
76+
if: github.ref == 'refs/heads/main'
77+
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v3
81+
with:
82+
fetch-depth: 0
83+
84+
- name: Configure Git
85+
run: |
86+
git config user.name "$GITHUB_ACTOR"
87+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
88+
89+
- name: Run chart-releaser
90+
uses: helm/chart-releaser-action@v1.5.0
91+
with:
92+
charts_dir: deployment
93+
env:
94+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

deployment/kubernetes/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: A Helm chart for the Repository Scanner
44

55
type: application
66

7-
version: 1.0.0
7+
version: 1.0.1
88

9-
appVersion: "1.0.0"
9+
appVersion: "1.0.1"
1010

1111
dependencies:
1212
- name: resc-vcs-instances

deployment/kubernetes/README.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [Prerequisites](#prerequisites)
99
- [Testing templates](#testing-templates)
1010
- [Deploying charts](#deploying-charts)
11+
- [Github as Helm Chart Repository](#github-as-helm-chart-repository)
1112
4. [Additional Information](#additional-information)
1213
- [Trigger scanning](#trigger-scanning)
1314
- [Connect to database using Azure Data Studio](#connect-to-database-using-azure-data-studio)
@@ -49,7 +50,7 @@ curl https://raw.githubusercontent.com/zricethezav/gitleaks/master/config/gitlea
4950
Create two folders in your user folder and name them _database_ and _rabbitmq_ as described below.
5051

5152
Windows: C:\Users\<username>\resc\database and C:\Users\<username>\resc\rabbitmq
52-
Linux: /Users/<username>/var/resc/database and /Users/<username>/var/resc/rabbitmq
53+
Linux: /Users/<username>/var/resc/database and /Users/<username>/var/resc/rabbitmq
5354

5455
Update persistent volume claim path and hostOS for database.
5556
```
@@ -92,8 +93,8 @@ Below is an example for how to scan repositories from GitHub.
9293
For example, let's say you want to scan all the repositories for the following GitHub accounts.
9394
https://github.com/kubernetes
9495
https://github.com/docker
95-
96-
Then you need to add those accounts to scope like : ["kubernetes", "docker"]. All the repositories from those accounts will be scanned.
96+
97+
Then you need to add those accounts to scope like : ["kubernetes", "docker"]. All the repositories from those accounts will be scanned.
9798
* exceptions (optional): If you want to exclude any account from scan, then add it to exceptions. Default is empty exception.
9899
* usernameValue: Provide your GitHub username.
99100
* tokenValue: Provide your GitHub personal access token if you wish to scan private repositories.
@@ -134,10 +135,10 @@ Render chart templates locally and display the output.
134135
helm template resc . -f ./example-values.yaml --set-file global.secretScanRulePackConfig=./RESC-RULE.toml
135136
```
136137

137-
## Deploying charts
138+
## Deploying charts
138139
Make sure you have completed the [pre-requisite](#prerequisites) steps.
139140

140-
* Ensure the namespace is created, if not then run
141+
* Ensure the namespace is created, if not then run
141142
```bash
142143
kubectl create namespace resc
143144
```
@@ -146,11 +147,11 @@ Make sure you have completed the [pre-requisite](#prerequisites) steps.
146147
cd ./deployment/kubernetes/
147148
```
148149

149-
* Deploy the helm charts.
150+
* Deploy the helm charts.
150151
```bash
151152
helm install --namespace resc resc . -f ./example-values.yaml --set-file global.secretScanRulePackConfig=./RESC-RULE.toml
152153
```
153-
154+
154155
* Optionally, set the default namespace for all kubectl commands. Now you no longer need to specify the -n resc option for all the kubectl commands.
155156
```bash
156157
kubectl config set-context --current --namespace=resc
@@ -172,6 +173,12 @@ Make sure you have completed the [pre-requisite](#prerequisites) steps.
172173
helm uninstall resc --namespace resc
173174
```
174175

176+
### GitHub as Helm Chart Repository
177+
It is now possible to directly download the files from the Repository Scanner (RESC) GitHub Repository since it now also
178+
acts as a helm repository! This helm repository allows for a quicker and easier way to obtain the helm charts and use them
179+
on your machine. For a full step-by-step approach on how to install the helm charts, visit the README on the "gh-pages" branch
180+
linked [here](https://github.com/abnamro/repository-scanner/blob/gh-pages/README.md).
181+
175182
## Additional Information
176183
### Issue while pulling images?
177184
If any image is not getting pulled automatically from the registry, you can use `docker pull` command to pull that image manually.

0 commit comments

Comments
 (0)