Skip to content
Snippets Groups Projects

Resolve "optimize pipeline"

Merged Dominik Hebeler requested to merge 29-optimize-pipeline into master
Compare and Show latest version
3 files
+ 52
18
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -61,29 +61,61 @@ spec:
emptyDir: {}
- name: vendor
emptyDir: {}
- name: css
- name: public
emptyDir: {}
- name: packages
persistentVolumeClaim:
claimName: packages
initContainers:
- name: {{ .Chart.Name }}-nodejs
- name: {{ .Chart.Name }}-assets
image: {{ template "imagename" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ['sh', '-c', 'npm i --cache .npm --prefer-offline --no-audit --progress=false && npm run prod']
command: ['sh', '-c']
args:
- if [ -f /packages/node_modules.tar.gz ];
then
echo 'Extracting Node Modules';
time tar -xzf /packages/node_modules.tar.gz;
fi;
if [ -f /packages/.npm.tar.gz ];
then
echo 'Extracting NPM Cache';
time tar -xzf /packages/.npm.tar.gz;
else
mkdir -p .npm;
fi;
npm i --cache .npm --prefer-offline --no-audit --progress=false &&
npm run prod &&
echo 'Packaging new modules' &&
time tar -czf /packages/node_modules.tar.gz node_modules &&
echo 'Packaging NPM Cache' &&
time tar -czf /packages/.npm.tar.gz .npm &&
cp -a ./public/. /public/ &&
export COMPOSER_HOME=.composer &&
if [ -f /packages/vendor.tar.gz ];
then
echo 'Extracting Composer Modules';
time tar -xzf /packages/vendor.tar.gz;
fi;
if [ -f /packages/.npm.tar.gz ];
then
echo 'Extracting Composer Cache';
time tar -xzf /packages/.composer.tar.gz;
else
mkdir -p .composer;
fi;
composer install --no-dev &&
echo 'Packaging new modules' &&
time tar -czf /packages/vendor.tar.gz vendor &&
echo 'Packaging Composer Cache' &&
time tar -czf /packages/.composer.tar.gz .composer
volumeMounts:
- mountPath: /html/node_modules
name: node-modules
- mountPath: /html/public/css
name: css
- mountPath: /html/.npm
- mountPath: /public
name: public
- mountPath: /packages
name: packages
subPath: .npm
- name: {{ .Chart.Name }}-composer
image: {{ template "imagename" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ['sh', '-c', 'composer install --no-dev']
volumeMounts:
- mountPath: /html/vendor
name: vendor
containers:
@@ -109,8 +141,8 @@ spec:
name: node-modules
- mountPath: /html/vendor
name: vendor
- mountPath: /html/public/css
name: css
- mountPath: /html/public
name: public
{{- if .Values.lifecycle }}
lifecycle:
{{ toYaml .Values.lifecycle | indent 10 }}
@@ -149,8 +181,8 @@ spec:
name: node-modules
- mountPath: /html/vendor
name: vendor
- mountPath: /html/public/css
name: css
- mountPath: /html/public
name: public
ports:
- name: "{{ .Values.service.name }}"
containerPort: {{ .Values.service.internalPort }}
@@ -197,8 +229,8 @@ spec:
name: node-modules
- mountPath: /html/vendor
name: vendor
- mountPath: /html/public/css
name: css
- mountPath: /html/public
name: public
livenessProbe:
exec:
command:
Loading