Skip to content

Commit 133d764

Browse files
authored
Merge pull request #8 from jpopelka/chart-releaser-action
Workflow to automate releasing the Helm charts
2 parents 7bd04fb + 68d795b commit 133d764

File tree

6 files changed

+89
-12
lines changed

6 files changed

+89
-12
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Configure Git
18+
run: |
19+
git config user.name "$GITHUB_ACTOR"
20+
git config user.email "[email protected]"
21+
22+
- name: Install Helm
23+
uses: azure/setup-helm@v3
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Run chart-releaser
28+
uses: helm/chart-releaser-action@v1
29+
with:
30+
charts_dir: ocp-helm-charts
31+
env:
32+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# HOWTO: https://pre-commit.com/#usage
2+
# pip3 install pre-commit
3+
# pre-commit install -t pre-commit -t pre-push
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.3.0
8+
hooks:
9+
- id: check-merge-conflict
10+
- id: check-symlinks
11+
- id: detect-private-key
12+
- id: end-of-file-fixer
13+
- id: mixed-line-ending
14+
- id: trailing-whitespace
15+
- repo: https://github.com/gruntwork-io/pre-commit
16+
rev: v0.1.17
17+
hooks:
18+
- id: helmlint
19+
- repo: https://github.com/packit/pre-commit-hooks
20+
rev: 8db5a24e01b9f54aaa7a800f33c4b9aa619af1b9
21+
hooks:
22+
- id: check-rebase
23+
args:
24+
- https://github.com/packit/udp.git
25+
stages: [manual, push]

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# udp
22

3-
[Unified Openshift deployment Project](https://docs.google.com/presentation/d/1MlLuuawzxJg6U15zbPby6JAtNNEWZAhfGEWNcpYSWeo) for the [Packit Validation Service](https://github.com/packit/deployment/tree/main/cron-jobs/packit-service-validation).
3+
[Unified Openshift deployment Project](https://docs.google.com/presentation/d/1MlLuuawzxJg6U15zbPby6JAtNNEWZAhfGEWNcpYSWeo)
4+
for the [Packit Service Validation](https://github.com/packit/deployment/tree/main/cron-jobs/packit-service-validation).
45

5-
To deploy the *Packit Validation Service* through *Helm* into *cyborg* follow this steps:
6+
To deploy the *Packit Service Validation* through *Helm* follow this steps:
67

78
### Setup deployment
89

9-
Helm uses an **image** created through a GitHub action and pushed to Quay.io, the **tag** for this image is the first *7 digit for the commit SHA* of the packit/deployment repo.
10+
Helm uses an **image** created through a GitHub action and pushed to Quay.io,
11+
the **tag** for this image is the first *7 digit for the commit SHA* of the packit/deployment repo.
1012

1113
To use a new image update the referenced tag [here](https://github.com/packit/udp/blob/main/ocp-deployments/packit-service-validation-prod.yaml#L18).
1214

@@ -20,12 +22,31 @@ export PACKIT_SENTRY=$( echo -n 'token from bitwarden' | base64 )
2022
export PACKIT_GITHUB_TOKEN=$( echo -n 'token from bitwarden' | base64 )
2123
```
2224

23-
### Install Service
25+
### Install Helm Chart
26+
27+
#### From this repo
2428
```
25-
helm upgrade --install --cleanup-on-fail packit-service-validation ocp-helm-charts/packit-service-validation/ --set oc_namespace=cyborg --set secrets.sentry=${PACKIT_SENTRY} --set secrets.github=${PACKIT_GITHUB_TOKEN} --values ocp-deployments/packit-service-validation-prod.yaml
29+
helm upgrade --install --cleanup-on-fail packit-service-validation ocp-helm-charts/packit-service-validation/ --set secrets.sentry=${PACKIT_SENTRY} --set secrets.github=${PACKIT_GITHUB_TOKEN} --values ocp-deployments/packit-service-validation-prod.yaml
2630
```
2731

28-
### Uninstall Service
32+
#### From chart repository
33+
```
34+
helm repo add packit https://helm.packit.dev
35+
helm repo update
36+
helm upgrade --install --cleanup-on-fail packit-service-validation packit/packit-service-validation --set secrets.sentry=${PACKIT_SENTRY} --set secrets.github=${PACKIT_GITHUB_TOKEN} --values ocp-deployments/packit-service-validation-prod.yaml
37+
```
38+
39+
### Uninstall Helm Chart
2940
```
3041
helm uninstall packit-service-validation
3142
```
43+
44+
### Releases
45+
There's a [release workflow](.github/workflows/release.yml) to automate releasing the Helm charts.
46+
It uses [Helm Chart Releaser Action](https://github.com/marketplace/actions/helm-chart-releaser)
47+
which turns this project into a self-hosted Helm chart repository.
48+
It does this – during every push to `main` – by checking each chart in the project,
49+
and whenever there's a new chart version, creates a corresponding GitHub release
50+
named for the chart version, adds Helm chart artifacts to the release,
51+
and creates or updates an `index.yaml` file with metadata about those releases,
52+
which is then hosted on GitHub Pages at https://helm.packit.dev.

ocp-deployments/packit-service-validation-prod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ env_variables:
3232
deployment:
3333
value: production
3434

35-
# Cron job parameters
35+
# Cron job parameters
3636
cron:
3737
# Schedule
3838
# runs every day at 4 a.m.
3939
schedule: "0 4 * * *"
40-
concurrencyPolicy: "Allow"
40+
concurrencyPolicy: "Allow"
4141
startingDeadlineSeconds: 14400
4242
suspend: false
4343
successfulJobsHistoryLimit: 5

ocp-helm-charts/packit-service-validation/Chart.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion : v1
1+
apiVersion : v2
22
name : packit-service-validation
33
description : Helm chart for deploying packit-service-validation app
44
type : application
@@ -13,4 +13,3 @@ keywords:
1313
maintainers:
1414
- name : Serhii Turivnyi
1515
16-

ocp-helm-charts/packit-service-validation/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ env_variables:
3232
deployment:
3333
value: production
3434

35-
# Cron job parameters
35+
# Cron job parameters
3636
cron:
3737
# Schedule
3838
schedule:
39-
concurrencyPolicy: "Allow"
39+
concurrencyPolicy: "Allow"
4040
startingDeadlineSeconds: ~
4141
suspend: false
4242
successfulJobsHistoryLimit: 5

0 commit comments

Comments
 (0)