Skip to content

Commit

Permalink
Merge pull request #1 from lemeurherve/issue4-check-chart-versions-bumps
Browse files Browse the repository at this point in the history
Issue4 check chart versions bumps
  • Loading branch information
lemeurherve authored Aug 10, 2023
2 parents 34fed02 + 31ad2f2 commit e2ad915
Show file tree
Hide file tree
Showing 74 changed files with 604 additions and 647 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-chart-versions-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check if modified chart versions have been bumped
on:
push: null
pull_request: null
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: list_modified_folders
name: List modified folders
if: github.ref != 'refs/heads/main'
run: |
# Get the list of modified files and folders
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changes.txt
# Extract the unique folder paths
awk -F/ '{print $1}' changes.txt | sort --unique > modified_folders.txt
# Store the modified folders as a step output
echo "::set-output name=modified_folders::$(cat modified_folders.txt)"
- id: check-bump
name: Check if every modified chart version has been bumped
if: github.ref != 'refs/heads/main'
run: |
# Read the modified folders from the previous step's output
IFS=$'\n' read -d '' -r -a folders <<< "${{ steps.list_modified_folders.outputs.modified_folders }}"
for folder in "${folders[@]}"; do
MAIN_CHART_VERSION=$(git show origin:charts/"${folder}"/Chart.yaml | grep "^version:")
PR_CHART_VERSION=$(git show ${{ github.event.before }}:charts/"${folder}"/Chart.yaml | grep "^version:")
if [ "$MAIN_CHART_VERSION" == "$PR_CHART_VERSION" ]; then
echo "ERROR: the version of the '${folder}' chart hasn't been bumped."
exit 1
fi
echo "The version of the '${folder}' chart has been bumped."
}
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Release Charts

on:
push:
branches:
- main
paths:
- 'charts/**'

# Only allow 1 release at a time (avoid concurent deployment to gh-pages)
concurrency: "release-chart"

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -18,16 +15,13 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3

uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
- name: Run chart-releaser
uses: helm/[email protected]
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5 changes: 2 additions & 3 deletions .github/workflows/sync-readme.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Sync README to gh-pages

on:
push:
branches:
Expand All @@ -10,10 +9,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: gh-pages
- run: |
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
---
name: Test Charts

on:
push:
pull_request:
workflow_dispatch:

push: null
pull_request: null
workflow_dispatch: null
env:
UNITTEST_VERSION: v0.3.4
jobs:
unit-tests:
runs-on: ubuntu-latest

strategy:
matrix:
chart:
- artifact-caching-proxy
- httpredirector
- jenkins-jobs
- jenkins-kubernetes-agents
- mirrorbits
- plugin-health-scoring
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -29,22 +27,20 @@ jobs:
current_helm_version="$(curl --silent --location https://raw.githubusercontent.com/jenkins-infra/docker-helmfile/main/Dockerfile | grep 'ARG' | grep 'HELM_VERSION=' | sort -u | cut -d'=' -f2)"
echo "CURRENT_HELM_VERSION=${current_helm_version}" >> $GITHUB_OUTPUT
- name: Set up Helm
uses: azure/setup-helm@v3
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
with:
version: "${{ steps.tools-versions.outputs.CURRENT_HELM_VERSION }}"

- name: install helm unittests
run: |
helm env
# Repeat 2 times to fight against network errors in GHA runners
# Always return true
helm plugin install https://github.com/quintush/helm-unittest \
|| helm plugin install https://github.com/quintush/helm-unittest \
helm plugin install https://github.com/helm-unittest/helm-unittest --version ${UNITTEST_VERSION} \
|| helm plugin install https://github.com/helm-unittest/helm-unittest --version ${UNITTEST_VERSION} \
|| true
# Fail if not installed
helm plugin list | grep unittest
- name: run unit tests
working-directory: ./charts/
run: |
helm unittest --helm3 "${{ matrix.chart }}"
helm unittest "${{ matrix.chart }}"
2 changes: 1 addition & 1 deletion charts/accountapp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: A Helm chart for accounts.jenkins.io
maintainers:
- name: timja
name: accountapp
version: 0.2.38
version: 0.5.26
4 changes: 4 additions & 0 deletions charts/accountapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ spec:
value: {{ .Values.smtp.auth | quote }}
- name: SMTP_SERVER
value: {{ .Values.smtp.server }}
- name: SMTP_SENDER
value: {{ .Values.smtp.sender }}
- name: SMTP_PORT
value: {{ .Values.smtp.port | quote }}
- name: SMTP_USER
value: {{ .Values.smtp.user }}
- name: APP_URL
Expand Down
49 changes: 24 additions & 25 deletions charts/accountapp/values.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Default values for accounts.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1
image:
repository: jenkinsciinfra/account-app
tag: 0.2.38
repository: jenkinsciinfra/account-app
tag: 0.4.29
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
port: 8080
type: ClusterIP
port: 8080
# Please define ingress settings into environment variable
ingress:
enabled: true
className: ""
enabled: true
className: ""
# annotations:
# "cert-manager.io/cluster-issuer": "letsencrypt-prod"
# "nginx.ingress.kubernetes.io/proxy-body-size": "500m"
Expand All @@ -29,9 +28,7 @@ ingress:
# - secretName: accounts-tls
# hosts:
# - accounts.jenkins.io

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
resources: # We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
Expand All @@ -45,24 +42,26 @@ nodeSelector: {}
tolerations: []
affinity: {}
ldap:
url: ldaps://ldap.jenkins.io:636/
managerDn: cn=admin,dc=jenkins-ci,dc=org
newUserBaseDn: ou=people,dc=jenkins-ci,dc=org
password:
url: ldaps://ldap.jenkins.io:636/
managerDn: cn=admin,dc=jenkins-ci,dc=org
newUserBaseDn: ou=people,dc=jenkins-ci,dc=org
password: null
jira:
username: accountapp
password:
url: https://issues.jenkins.io/
username: accountapp
password: null
url: https://issues.jenkins.io/
seats: 2
seniority: 12
smtp:
auth: true
server: smtp.sendgrid.net
user:
password:
auth: true
server: smtp.sendgrid.net
sender: [email protected]
port: 587
user: null
password: null
appUrl: https://accounts.jenkins.io
election:
open: 1970-01-01
close: 1970-01-02
logDir: /var/log/accountapp/elections
candidates: bob,alice
open: 1970-01-01
close: 1970-01-02
logDir: /var/log/accountapp/elections
candidates: bob,alice
2 changes: 1 addition & 1 deletion charts/artifact-caching-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
description: artifact-caching-proxy is a Nginx caching proxy in front of repo.jenkins-ci.org
name: artifact-caching-proxy
type: application
version: 0.10.3
version: 0.11.1
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ data:
# Optimize IO workload for static files
# https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/#enabling-sendfile
# https://www.sobyte.net/post/2022-08/nginx-send/
sendfile on;
sendfile_max_chunk 1m; # Limits chunks to 1 Megabytes;
tcp_nopush on;
# https://hub.packtpub.com/fine-tune-nginx-configufine-tune-nginx-configurationfine-tune-nginx-configurationratio/
sendfile on;
sendfile_max_chunk 2m;
tcp_nopush on;
tcp_nodelay on;
aio on;
directio 10m;
directio_alignment 4096;
keepalive_timeout 65;
Expand Down
4 changes: 2 additions & 2 deletions charts/artifact-caching-proxy/tests/defaults_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ tests:
- isKind:
of: ConfigMap
- isNotNull:
path: data.vhost-proxy\.conf
path: data["vhost-proxy.conf"]
- isNotNull:
path: data.vhost-status\.conf
path: data["vhost-status.conf"]
7 changes: 1 addition & 6 deletions charts/artifact-caching-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# Default values for artifact-caching-proxy.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "1.22.1-alpine"
tag: 1.24.0-alpine
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
# non root port
Expand Down Expand Up @@ -57,14 +54,12 @@ resources: {}
# requests:
# cpu: 100m
# memory: 128Mi

# Datadog Integration
datadog:
metricsCollection:
enabled: true
logCollection:
enabled: true

nodeSelector: {}
tolerations: []
affinity: {}
Expand Down
4 changes: 0 additions & 4 deletions charts/custom-distribution-service/Chart.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions charts/custom-distribution-service/templates/NOTES.txt

This file was deleted.

Loading

0 comments on commit e2ad915

Please sign in to comment.