Skip to content

Commit

Permalink
Merge pull request #1 from QJoly/common-0.2.0
Browse files Browse the repository at this point in the history
common: Added support to renovate
  • Loading branch information
qjoly authored Jul 2, 2023
2 parents d2f3bfa + 62f6a65 commit 50d1a29
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
---
name: Testing charts
on:
push:
branches:
- '*'
- '!main'
pull_request:
branches:
- main
types:
- opened
- synchronize
- edited
- reopened

jobs:
testing:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: yamllint .

test-charts:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python
uses: actions/[email protected]

- uses: azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files in the charts folder
id: changed-files-specific
uses: tj-actions/changed-files@v36
uses: tj-actions/changed-files@v37
with:
files: charts

- name: Create k8s Kind Cluster
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1.7.0

- name: Install kubectl
if: steps.changed-files-specific.outputs.any_changed == 'true'
Expand All @@ -38,9 +56,9 @@ jobs:
- name: Run lint for any chart concerned by the commit
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
.github/workflows/lint_modified_charts.sh ${{ steps.changed-files-specific.outputs.all_changed_files }}
.github/workflows/lint_modified_charts.sh ${{ steps.changed-files-specific.outputs.all_changed_files }}
- name: Run test for any chart concerned by the commit
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
.github/workflows/deploy_modified_charts.sh ${{ steps.changed-files-specific.outputs.all_changed_files }}
.github/workflows/deploy_modified_charts.sh ${{ steps.changed-files-specific.outputs.all_changed_files }}
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ maintainers:
- name: QJOLY
email: [email protected]
name: common
version: v0.1.0
version: v0.2.0
appVersion: "0"
kubeVersion: ">= 1.18"
home: https://github.com/RubxKube/common-charts
Expand Down
10 changes: 3 additions & 7 deletions charts/common/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ spec:
labels:
app: {{ .Release.Name }}
spec:
{{- if .Values.image.repository.isPrivate }}
{{- if .Values.image.repositorySettings.isPrivate }}
imagePullSecrets:
- name: "{{ .Values.image.repository.secretName }}"
- name: "{{ .Values.image.repositorySettings.secretName }}"
{{- end }}
containers:
- name: {{ .Release.Name }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.image.repository.name }}
image: "{{ .Values.image.repository.name }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
{{- else }}
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.app.containerPort }}
resources:
Expand Down
5 changes: 2 additions & 3 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ deployment:

# container
image:
repository:
name: null
repositorySettings:
isPrivate: false
secretName: null
name: nginx
repository: nginx
tag: latest
pullPolicy: Always

Expand Down

0 comments on commit 50d1a29

Please sign in to comment.