Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promoting Develop to Master #39

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 52 additions & 9 deletions .github/workflows/chart-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: Chart Release

on:
workflow_dispatch:
inputs:
plane-ce:
description: 'Build Plane CE'
type: boolean
default: false
plane-ee:
description: 'Build Plane EE'
type: boolean
default: false

env:
CR_CONFIGFILE: "${{ github.workspace }}/cr.yaml"
Expand All @@ -14,9 +23,13 @@ env:
TARGET_BRANCH: "${{ github.ref_name }}"
CHART_NAME_CE: "plane-ce"
CHART_NAME_ENTERPRISE: "plane-enterprise"
MARK_AS_LATEST: true
MARK_AS_PRERELASE: false
PAGES_INDEX_PATH: ""

jobs:
setup:
if: ${{ github.event.inputs.plane-ce == 'true' || github.event.inputs.plane-ee == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -60,20 +73,41 @@ jobs:

chmod 400 ${{env.GNUPGHOME}}/secring.gpg

- name: Remove unwanted charts
run: |
if [ "${{ github.event.inputs.plane-ce }}" = "false" ]; then
rm -rf charts/${{ env.CHART_NAME_CE }}
fi
if [ "${{ github.event.inputs.plane-ee }}" = "false" ]; then
rm -rf charts/${{ env.CHART_NAME_ENTERPRISE }}
fi

- name: Rename Chart
if: github.ref_name != 'master'
run: |
flatBranchName=$(echo "${{ env.TARGET_BRANCH }}" | sed 's/\//\-/g')
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_CE }}/Chart.yaml
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_ENTERPRISE }}/Chart.yaml
if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_CE }}/Chart.yaml
fi

if [ "${{ github.event.inputs.plane-ee }}" = "true" ]; then
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/${{ env.CHART_NAME_ENTERPRISE }}/Chart.yaml
fi

echo "MARK_AS_LATEST=false" >> $GITHUB_ENV
echo "MARK_AS_PRERELASE=true" >> $GITHUB_ENV
echo "PAGES_INDEX_PATH=${flatBranchName}" >> $GITHUB_ENV

- name: Release Charts
uses: helm/[email protected].0
uses: mguptahub/[email protected].2
with:
charts_dir: charts
config: cr.yaml
packages_with_index: false
skip_existing: true
mark_as_latest: ${{ env.MARK_AS_LATEST }}
prerelease: ${{ env.MARK_AS_PRERELASE }}
pages_index_path: ${{ env.PAGES_INDEX_PATH }}
env:
CR_TOKEN: ${{ env.CR_TOKEN }}
CR_KEY: ${{ env.GPG_KEY_NAME }}
Expand All @@ -82,7 +116,7 @@ jobs:
CR_SIGN: true

- id: publish-plane-enterprise
if: github.ref_name == 'master'
if: ${{ github.ref_name == 'master' && github.event.inputs.plane-ee == 'true' }}
name: Harbor Publish Plane-Enterprise
env:
CHART_REPO: ${{ env.CHART_NAME_ENTERPRISE }}
Expand Down Expand Up @@ -125,14 +159,23 @@ jobs:

- name: Copy Readme
run: |
cp code/charts/plane-ce/README.md pages/content/plane-ce.md
cp code/charts/plane-enterprise/README.md pages/content/plane-ee.md
if [ "${{ github.event.inputs.plane-ce }}" = "true" ]; then
cp code/charts/plane-ce/README.md pages/content/plane-ce.md
fi
if [ "${{ github.event.inputs.plane-ee }}" = "true" ]; then
cp code/charts/plane-enterprise/README.md pages/content/plane-ee.md
fi

- name: Publish pages
working-directory: pages
run: |
git add .
git commit -m "Updated READMEs"
git push

if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
# Commit and push the changes
git commit -m "Updated READMEs"
git push
fi


2 changes: 1 addition & 1 deletion charts/plane-ce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Meet Plane. An open-source software development tool to manage issu

type: application

version: 1.0.22
version: 1.0.24
appVersion: "0.22.0"

home: https://plane.so
Expand Down
2 changes: 0 additions & 2 deletions charts/plane-ce/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Plane CE Helm Chart

## Pre-requisite

- A working Kubernetes cluster
Expand Down
71 changes: 68 additions & 3 deletions charts/plane-ce/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ questions:
- variable: redis.volumeSize
label: "Volume Size"
type: string
default: "1Gi"
default: "100Mi"
show_if: "redis.local_setup=true"
- variable: redis.assign_cluster_ip
label: "Assign Cluster IP"
Expand Down Expand Up @@ -267,7 +267,7 @@ questions:
- variable: postgres.volumeSize
label: "Volume Size"
type: string
default: "5Gi"
default: "1Gi"
show_if: "postgres.local_setup=true"
- variable: env.pgdb_username
label: "Username"
Expand Down Expand Up @@ -295,6 +295,66 @@ questions:
default: "postrgres://"
show_if: "postgres.local_setup=false"

- variable: rabbitmq.local_setup
label: "Install RabbitMQ"
type: boolean
default: true
group: "RabbitMQ Setup"
subquestions:
- variable: rabbitmq.image
label: "Docker Image"
type: string
default: "rabbitmq:3.13.6-management-alpine"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.pullPolicy
label: "Image Pull Policy"
type: enum
options:
- "Always"
- "IfNotPresent"
- "Never"
default: "IfNotPresent"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.servicePort
label: Service Port
type: int
default: 5672
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.managementPort
label: Management Port
type: int
default: 15672
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.assign_cluster_ip
label: "Assign ClusterIP"
type: boolean
default: false
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.storageClass
label: "Storage Class"
type: string
default: "longhorn"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.volumeSize
label: "Volume Size"
type: string
default: "100Mi"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.default_user
label: "Username"
type: string
default: "plane"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.default_password
label: "Password"
type: password
default: "plane"
show_if: "rabbitmq.local_setup=true"
- variable: rabbitmq.external_rabbitmq_url
label: "Remote URL"
type: string
show_if: "rabbitmq.local_setup=false"

- variable: minio.local_setup
label: "Install Minio"
type: boolean
Expand Down Expand Up @@ -324,7 +384,7 @@ questions:
- variable: minio.volumeSize
label: "Volume Size"
type: string
default: "5Gi"
default: "1Gi"
show_if: "minio.local_setup=true"
- variable: minio.assign_cluster_ip
label: "Assign Cluster IP"
Expand Down Expand Up @@ -377,6 +437,11 @@ questions:
type: string
default: "plane-minio.example.com"
show_if: "minio.local_setup=true"
- variable: ingress.rabbitmqHost
label: "Rabbitmq Host"
type: string
default: "plane-rabbitmq.example.com"
show_if: "rabbitmq.local_setup=true"
- variable: ingress.ingressClass
label: "Ingress Classname"
type: string
Expand Down
3 changes: 3 additions & 0 deletions charts/plane-ce/templates/certs/certs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ spec:
{{- if and .Values.minio.local_setup .Values.ingress.minioHost }}
- {{ .Values.ingress.minioHost | quote }}
{{- end }}
{{- if and .Values.rabbitmq.local_setup .Values.ingress.rabbitmqHost }}
- {{ .Values.ingress.rabbitmqHost | quote }}
{{- end }}
issuerRef:
name: {{ .Release.Name }}-cert-issuer
secretName: {{ .Release.Name }}-ssl-cert
Expand Down
8 changes: 8 additions & 0 deletions charts/plane-ce/templates/config-secrets/app-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ data:
{{- else }}
DATABASE_URL: ""
{{ end }}

{{- if .Values.rabbitmq.local_setup }}
AMQP_URL: "amqp://{{ .Values.rabbitmq.default_user}}:{{ .Values.rabbitmq.default_password}}@{{ .Release.Name }}-rabbitmq.{{ .Release.Namespace }}.svc.{{ .Values.env.default_cluster_domain | default "cluster.local" }}/"
{{- else if .Values.rabbitmq.external_rabbitmq_url }}
AMQP_URL: {{ .Values.rabbitmq.external_rabbitmq_url}}
{{- else }}
AMQP_URL: ""
{{ end }}
14 changes: 14 additions & 0 deletions charts/plane-ce/templates/config-secrets/rabbitmqdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.rabbitmq.local_setup }}

apiVersion: v1
kind: Secret
type: Opaque
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-rabbitmq-secrets
data:
RABBITMQ_DEFAULT_USER: {{ .Values.rabbitmq.default_user | default "plane" | b64enc | quote }}
RABBITMQ_DEFAULT_PASS: {{ .Values.rabbitmq.default_password | default "plane" | b64enc |quote }}
---

{{- end }}
17 changes: 16 additions & 1 deletion charts/plane-ce/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,28 @@ spec:
path: /
pathType: Prefix
{{- end }}
{{- if and .Values.rabbitmq.local_setup .Values.ingress.rabbitmqHost }}
- host: {{ .Values.ingress.rabbitmqHost }}
http:
paths:
- backend:
service:
port:
number: 15672
name: {{ .Release.Name }}-rabbitmq
path: /
pathType: Prefix
{{- end }}
{{- if .Values.ssl.generateCerts }}
tls:
- hosts:
- {{ .Values.ingress.appHost | quote }}
{{- if and .Values.minio.local_setup .Values.ingress.minioHost }}
- {{ .Values.ingress.minioHost | quote }}
{{ end }}
{{- end }}
{{- if and .Values.rabbitmq.local_setup .Values.ingress.rabbitmqHost }}
- {{ .Values.ingress.rabbitmqHost | quote }}
{{- end }}
secretName: {{ .Release.Name }}-ssl-cert
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion charts/plane-ce/templates/workloads/minio.stateful.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.minio.volumeSize | default "5Gi" | quote }}
storage: {{ .Values.minio.volumeSize | default "1Gi" | quote }}
storageClassName: {{ .Values.minio.storageClass }}
volumeMode: Filesystem

Expand Down
2 changes: 1 addition & 1 deletion charts/plane-ce/templates/workloads/postgres.stateful.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.postgres.volumeSize | default "5Gi" | quote }}
storage: {{ .Values.postgres.volumeSize | default "1Gi" | quote }}
storageClassName: {{ .Values.postgres.storageClass }}
volumeMode: Filesystem

Expand Down
73 changes: 73 additions & 0 deletions charts/plane-ce/templates/workloads/rabbitmq.stateful.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{- if .Values.rabbitmq.local_setup }}

apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-rabbitmq
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-rabbitmq
spec:
{{- if not .Values.rabbitmq.assign_cluster_ip }}
clusterIP: None
{{- end }}
ports:
- name: rabbitmq-{{ .Values.rabbitmq.servicePort }}
port: {{ .Values.rabbitmq.servicePort }}
protocol: TCP
targetPort: 5672
- name: rabbitmq-mgmt-{{ .Values.rabbitmq.managementPort }}
port: {{ .Values.rabbitmq.managementPort }}
protocol: TCP
targetPort: 15672
selector:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-rabbitmq
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-rabbitmq-wl
spec:
selector:
matchLabels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-rabbitmq
serviceName: {{ .Release.Name }}-rabbitmq
template:
metadata:
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-rabbitmq
spec:
containers:
- image: {{ .Values.rabbitmq.image }}
imagePullPolicy: {{ .Values.rabbitmq.pullPolicy | default "IfNotPresent" | quote }}
name: {{ .Release.Name }}-rabbitmq
stdin: true
tty: true
envFrom:
- secretRef:
name: {{ .Release.Name }}-rabbitmq-secrets
optional: false
volumeMounts:
- mountPath: /var/lib/rabbitmq
name: pvc-{{ .Release.Name }}-rabbitmq-vol
subPath: ''
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
namespace: {{ .Release.Namespace }}
name: pvc-{{ .Release.Name }}-rabbitmq-vol
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.rabbitmq.volumeSize | default "100Mi" | quote }}
storageClassName: {{ .Values.rabbitmq.storageClass }}
volumeMode: Filesystem

{{- end }}
Loading