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

Fix/serviceaccount creation #65

Merged
merged 9 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
28 changes: 28 additions & 0 deletions .github/workflows/create_dev_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create dev build

on:
workflow_dispatch:

jobs:
create_dev_build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract Chart Version
id: chart_version
run: |
version=$(yq e '.version' ./test-chart/Chart.yaml)
echo "version=$version" >> $GITHUB_ENV

- name: Dispatch event to create dev build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: caas-team/GoKubeDownscaler
event-type: create-dev-build
client-payload: '{"version": "${{ env.version }}-dev"}'
jonathan-mayer marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 15 additions & 2 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push Image

on:
repository_dispatch:
types: [release-new-version]
types: [release-new-version, create-dev-build]

jobs:
build:
Expand All @@ -13,6 +13,7 @@ jobs:

- name: Docker meta
id: meta
if: github.event.action == 'release-new-version'
uses: docker/metadata-action@v5
with:
images: |
Expand All @@ -22,6 +23,16 @@ jobs:
latest
jonathan-mayer marked this conversation as resolved.
Show resolved Hide resolved
${{ github.event.client_payload.appVersion }}

- name: Dev docker meta
id: dev-meta
if: github.event.action == 'create-dev-build'
uses: docker/metadata-action@v5
with:
images: |
mtr.devops.telekom.de/caas/go-kube-downscaler
ghcr.io/caas-team/gokubedownscaler
tags: dev

jonathan-mayer marked this conversation as resolved.
Show resolved Hide resolved
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
Expand Down Expand Up @@ -54,7 +65,9 @@ jobs:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.dev-meta.outputs.tags }}

- name: Sign Push
run: |
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/helm_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and push helm chart

on:
repository_dispatch:
types: [build-new-chart]
types: [build-new-chart, create-dev-build]

jobs:
build_and_push:
Expand All @@ -26,6 +26,7 @@ jobs:
MTR: mtr.devops.telekom.de

- name: Helm Lint, Package, and Push
if: github.event.action == 'release-new-version'
run: |
cd deployments/chart
helm lint .
Expand All @@ -36,6 +37,18 @@ jobs:
MTR: mtr.devops.telekom.de
REPO: caas

- name: Helm Lint, Package, and Push Dev Build
if: github.event.action == 'create-dev-build'
run: |
cd deployments/chart
helm lint .
helm package . --version ${{ github.event.client_payload.version }} --app-version dev
helm push $(ls *.tgz | head -1) oci://ghcr.io/caas-team/charts
helm push $(ls *.tgz | head -1) oci://${MTR}/${REPO}/charts
env:
MTR: mtr.devops.telekom.de
REPO: caas

jonathan-mayer marked this conversation as resolved.
Show resolved Hide resolved
- name: Dispatch Event to Helm-Charts Repo
uses: peter-evans/repository-dispatch@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions deployments/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sources:
maintainers:
- name: jonathan-mayer
email: [email protected]
url: https://www.telekom.com
url: https://github.com/jonathan-mayer
- name: JTaeuber
email: [email protected]
url: https://www.telekom.com
url: https://github.com/JTaeuber
2 changes: 2 additions & 0 deletions deployments/chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "go-kube-downscaler.serviceAccountName" . }}
{{- end }}