Skip to content

Commit

Permalink
Add copy from source
Browse files Browse the repository at this point in the history
  • Loading branch information
xvilo committed Aug 17, 2023
1 parent 3793995 commit 87c94e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/symfony-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: symfony-app
description: A simple chart to deploy basic Symfony/PHP applications
type: application
version: 0.4.0
version: 0.4.1
appVersion: 'main'
keywords:
- php
Expand All @@ -17,4 +17,4 @@ annotations:
# Supported kind: added, changed, deprecated, removed, fixed and security
artifacthub.io/changes: |
- kind: added
description: "Added the option to spawn Symfony Messenger consumers"
description: "Added the option to copy over the source from the FPM image into the nginx container"
12 changes: 12 additions & 0 deletions charts/symfony-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ spec:
image: "{{ .Values.image.fpm.repository }}:{{ .Values.image.fpm.tag }}"
imagePullPolicy: {{ .Values.image.fpm.pullPolicy }}
workingDir: /app
{{- if .Values.source.copyFromFpm }}
lifecycle:
postStart:
exec:
command: [ "/bin/sh", "-c", "cp -r /app/. /app-shared" ]
{{- end }}
{{- include "symfony-app.env" . | nindent 10 }}
ports:
- name: fpm
Expand All @@ -61,9 +67,15 @@ spec:
{{- toYaml .Values.probes.fpm | nindent 10 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if not .Values.source.copyFromFpm }}
volumeMounts:
- name: app-directory
mountPath: /app
{{- else }}
volumeMounts:
- name: app-directory
mountPath: /app-shared
{{- end }}
{{- if .Values.pyroscope.enabled }}
command: ['pyroscope']
args: ['exec', '-spy-name', 'phpspy', 'php-fpm']
Expand Down
1 change: 1 addition & 0 deletions charts/symfony-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ image:
##
# Only https sources are supported
source:
copyFromFpm: true
clone: true
remote: https://github.com/symfony/demo.git
version: 'v2.2.3'
Expand Down

0 comments on commit 87c94e3

Please # to comment.