Skip to content
Open
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
65 changes: 65 additions & 0 deletions .github/workflows/updateImageTag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Update Image-Tag in values.yaml

on:
workflow_dispatch:
inputs:
path-to-values-yaml:
description: "Path to values.yaml"
required: true
image-tag:
description: "New Image-Tag"
required: true
path-to-image-tag-field-in-file:
description: "Path/Keys to Image-Tag Field in values.yaml file"
required: true
path-to-chart-yaml:
description: "Path to Chart.yaml"
required: true
permissions:
contents: write
pull-requests: write
env:
GH_TOKEN: ${{ github.token }}
REPO_URL: "https://github.com/${{ github.repository }}"
PATH_TO_VALUES_FILE: ${{ inputs.path-to-values-yaml }}
IMAGE_TAG: ${{ inputs.image-tag }}
PATH_TO_IMAGE_TAG: ${{ inputs.path-to-image-tag-field-in-file }}
PATH_TO_CHART: ${{ inputs.path-to-chart-yaml }}

jobs:
update-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python Packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Python script
run: python update_image_version_in_values_yaml.py --pathToValuesYaml $PATH_TO_VALUES_FILE --imageTag $IMAGE_TAG --pathToImageTagField $PATH_TO_IMAGE_TAG --pathToChart $PATH_TO_CHART
- name: Commit Files and create Pull-Request
run: |
git config --global user.name 'Your Name'
git config --global user.email 'your-username@users.noreply.github.com'
if [ -n "$(git status --porcelain)" ]; then
NEW_BRANCH="update-$PATH_TO_VALUES_FILE-$IMAGE_TAG"
PR_TITLE="Update Image-Tag in $PATH_TO_VALUES_FILE to $IMAGE_TAG"
PR_BODY="This PR updates the Image-Tag in [$PATH_TO_VALUES_FILE]($REPO_URL/blob/$NEW_BRANCH/$PATH_TO_VALUES_FILE) to $IMAGE_TAG"
git fetch --all
git commit -am "Update Image-Tag in $PATH_TO_VALUES_FILE to $IMAGE_TAG"
if git show-ref --verify --quiet refs/remotes/origin/$NEW_BRANCH; then
git checkout $NEW_BRANCH
git pull
else
git checkout -b $NEW_BRANCH
fi
git push --set-upstream origin $NEW_BRANCH
gh pr create --base main --head $NEW_BRANCH --title "$PR_TITLE" --body "$PR_BODY"
else
echo "No changes to commit"
fi
130 changes: 130 additions & 0 deletions charts/sps-sample/charts/backend/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
global:
backend:
name: backend
# Default values for backend.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: ghcr.io/it-at-m/refarch/refarch-backend
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
podLabels: {}

podSecurityContext:
{}
# fsGroup: 2000

securityContext:
# Security-Settings recommended from https://github.com/Checkmarx/kics
capabilities:
drop:
- ALL
# readOnlyRootFilesystem: true
runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

ingress:
enabled: false
className: ""
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

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:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

startupProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 60
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
# Additional env on the output Deployment definition.
env: []
nodeSelector: {}

tolerations: []

affinity: {}

extraInitContainers: {}

lifecycle:
preStop:
exec:
command:
- sh
- -c
- sleep 10
115 changes: 115 additions & 0 deletions charts/sps-sample/charts/frontend/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
global:
frontend:
name: frontend

# Default values for frontend.
# 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: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
podLabels: {}

podSecurityContext:
{}
# fsGroup: 2000

securityContext:
# Security-Settings recommended from https://github.com/Checkmarx/kics
capabilities:
drop:
- ALL
# readOnlyRootFilesystem: true
runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

ingress:
enabled: false
className: ""
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

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:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true

nodeSelector: {}

tolerations: []

affinity: {}
Loading