Skip to content

Commit

Permalink
Added helm chart ability to deploy cuncurrent pull requests (#102)
Browse files Browse the repository at this point in the history
This will enable ArgoCD ApplicationSet name as suffix to GitHub and GitLab App names, and renamed GitLab file from pr to mr as suffix

Other minor changes include:
- Add platform annotations to services
- Updated HELM chart keywords
- Updated Chart annotation artifacthub changelog
- Updated chart documentation
- Update chart values example
  • Loading branch information
saidsef authored Apr 27, 2023
1 parent 2f884a8 commit 024954d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
15 changes: 10 additions & 5 deletions charts/applicationset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-applicationsets-services
description: A HELM Chart for ArgoCD ApplicationSets for Kubernetes
type: application
version: &version "0.9.1"
version: &version "0.10.1"
appVersion: *version
kubeVersion: ">= 1.23"
home: https://github.com/saidsef/argocd-applicationsets-services
Expand All @@ -11,9 +11,10 @@ keywords:
- argoproj
- argocd
- gitops
- continuous deployment
- applicationsets
- argocd-applicationsets
- preview-environment
- preview
- canary
maintainers:
- name: saidsef
url: https://saidsef.github.io/argocd-applicationsets-services
Expand All @@ -23,13 +24,17 @@ annotations:
artifacthub.io/license: "Apache-2.0"
artifacthub.io/changes: |
- kind: changed
description: Updated to add AppSet name as suffix to GitHub and GitLab App names
description: change ability to deploy services to different namespaces
- kind: changed
description: Renamed GitLab file from pr to mr as suffix
description: change AppSet name to be included in service name - this allows multi-labeling
- kind: added
description: added artifacthub link to HELM documentation
artifacthub.io/links: |
- name: README
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/README.md
- name: LICENSE
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/LICENSE.md
- name: CONTRIBUTING
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/CONTRIBUTING.md
- name: HELM
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/charts/applicationset/README.md
6 changes: 3 additions & 3 deletions charts/applicationset/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argocd-applicationsets-services

![Version: 0.8.20](https://img.shields.io/badge/Version-0.8.20-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.20](https://img.shields.io/badge/AppVersion-0.8.20-informational?style=flat-square)
![Version: 0.10.1](https://img.shields.io/badge/Version-0.10.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.10.1](https://img.shields.io/badge/AppVersion-0.10.1-informational?style=flat-square)

A HELM Chart for ArgoCD ApplicationSets for Kubernetes

Expand All @@ -24,8 +24,8 @@ Kubernetes: `>= 1.23`

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| github | object | `{"api":"https://api.github.com","label":"preview","owner":"saidsef","path":"deployment","secretKey":"","secretName":""}` | GitHub repo configuration parameters |
| gitlab | object | `{"api":"https://gitlab.com","group":"saidsef","label":"preview","path":"deployment","secretKey":"","secretName":""}` | GitLab repo configuration parameters |
| github | object | `{"api":"https://api.github.com","enabled":true,"label":"preview","owner":"saidsef","path":"deployment","secretKey":"","secretName":""}` | GitHub repo configuration parameters |
| gitlab | object | `{"api":"https://gitlab.com","enabled":true,"group":"saidsef","label":"preview","path":"deployment","secretKey":"","secretName":""}` | GitLab repo configuration parameters |
| globals | object | `{"deployToNamespace":"previews","label":"preview","notificationChannel":"argocd","requeueAfterSeconds":500,"retryBackoffDuration":"10s","revisionHistoryLimit":2,"server":"https://kubernetes.default.svc"}` | Global default variables |
| globals.deployToNamespace | string | `"previews"` | Kubernetes namespace to deploy previews |
| globals.label | string | `"preview"` | GitHub label to filter PRs that you want to target |
Expand Down
5 changes: 3 additions & 2 deletions charts/applicationset/templates/github-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ metadata:
namespace: {{ required "A valied namespace is required" $namespace | replace "." "-" }}
labels:
app.kubernetes.io/name: {{ $repo.name }}
app.kubernetes.io/platform: 'github'
annotations:
app.kubernetes.io/managed-by: {{ $.Release.Service }}
helm.sh/chart: '{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}'
Expand All @@ -45,7 +46,7 @@ spec:
requeueAfterSeconds: {{ $refresh | default 500 }}
template:
metadata:
name: {{ printf "pr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb }}
name: {{ printf "pr-%sbranch_slug%s-%snumber%s-%s" $dqf $dqb $dqf $dqb $name }}
labels:
app.kubernetes.io/name: {{ $repo.name }}
app.kubernetes.io/branch: {{ $branch }}
Expand Down Expand Up @@ -113,6 +114,6 @@ spec:
duration: {{ $retryBackoffDuration }}
destination:
server: {{ $server }}
namespace: {{ coalesce $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }}
namespace: {{ coalesce $repo.namespace $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }}
{{- end }}
{{- end }}
5 changes: 3 additions & 2 deletions charts/applicationset/templates/gitlab-mr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ metadata:
namespace: {{ required "A valied namespace is required" $namespace | replace "." "-" }}
labels:
app.kubernetes.io/name: {{ $repo.name }}
app.kubernetes.io/platform: 'gitlab'
annotations:
app.kubernetes.io/managed-by: {{ $.Release.Service }}
helm.sh/chart: '{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}'
Expand All @@ -44,7 +45,7 @@ spec:
requeueAfterSeconds: {{ $refresh | default 500 }}
template:
metadata:
name: {{ printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb }}
name: {{ printf "mr-%sbranch_slug%s-%snumber%s-%s" $dqf $dqb $dqf $dqb $name }}
labels:
app.kubernetes.io/name: {{ $repo.name }}
app.kubernetes.io/branch: {{ $branch }}
Expand Down Expand Up @@ -112,6 +113,6 @@ spec:
duration: {{ $retryBackoffDuration }}
destination:
server: {{ $server }}
namespace: {{ coalesce $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }}
namespace: {{ coalesce $repo.namespace $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/applicationset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ repos:
# - name: service-a
# path: 'deployment/preview'
# project: 13
# namespace: preview
# repoUrl: 'https://gitlab.com/project/service-a.git'
github:
- name: node-webserver
Expand Down

0 comments on commit 024954d

Please sign in to comment.