node: checkout revision in init container

This commit is contained in:
Sameer Naik
2017-03-01 11:30:00 +05:30
parent c1a208b1aa
commit cdb511f91f
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ spec:
"name": "git-clone-app",
"image": "{{ .Values.image }}",
"imagePullPolicy": "{{ .Values.imagePullPolicy }}",
"command": [ "/bin/sh", "-c" , "git clone {{ .Values.repository }} /app && git checkout {{ .Values.revision }}" ],
"command": [ "/bin/sh", "-c" , "git clone {{ .Values.repository }} /app && git checkout {{ .Values.revision }}" ],
"volumeMounts": [
{
"name": "app",
+1 -2
View File
@@ -19,7 +19,7 @@ spec:
"name": "git-clone-app",
"image": "{{ .Values.image }}",
"imagePullPolicy": "{{ .Values.imagePullPolicy }}",
"command": [ "/bin/sh", "-c" , "git clone {{ .Values.repository }} /app" ],
"command": [ "/bin/sh", "-c" , "git clone {{ .Values.repository }} /app && git checkout {{ .Values.revision }}" ],
"volumeMounts": [
{
"name": "node-data",
@@ -40,7 +40,6 @@ spec:
- "/bin/bash"
- "-ec"
- |
git checkout {{ .Values.revision }}
chown -R bitnami:daemon /app
su bitnami -c 'PATH=$PATH:/opt/bitnami/node/bin/ npm install'
su bitnami -c 'PATH=$PATH:/opt/bitnami/node/bin/ npm start'