Skip to content

Commit

Permalink
fix: source ~/.profile file to load plataform's env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nettoclaudio committed Feb 7, 2023
1 parent 701d1f5 commit 34b16d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/build/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ COPY ./application.tar.gz /home/application/archive.tar.gz
RUN --mount=type=secret,id=tsuru-app-envvars,target=/var/run/secrets/envs.sh,uid=1000,gid=1000 \
[ -f /var/run/secrets/envs.sh ] && . /var/run/secrets/envs.sh \
&& [ -f ~/.profile ] && . ~/.profile \
&& /var/lib/tsuru/deploy archive file:///home/application/archive.tar.gz \
{{- range $_, $hook := .BuildHooks }}
&& { sh -lc {{ shellQuote . }}; } \
Expand Down
2 changes: 2 additions & 0 deletions pkg/build/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ COPY ./application.tar.gz /home/application/archive.tar.gz
RUN --mount=type=secret,id=tsuru-app-envvars,target=/var/run/secrets/envs.sh,uid=1000,gid=1000 \
[ -f /var/run/secrets/envs.sh ] && . /var/run/secrets/envs.sh \
&& [ -f ~/.profile ] && . ~/.profile \
&& /var/lib/tsuru/deploy archive file:///home/application/archive.tar.gz \
&& :
`,
Expand All @@ -344,6 +345,7 @@ COPY ./application.tar.gz /home/application/archive.tar.gz
RUN --mount=type=secret,id=tsuru-app-envvars,target=/var/run/secrets/envs.sh,uid=1000,gid=1000 \
[ -f /var/run/secrets/envs.sh ] && . /var/run/secrets/envs.sh \
&& [ -f ~/.profile ] && . ~/.profile \
&& /var/lib/tsuru/deploy archive file:///home/application/archive.tar.gz \
&& { sh -lc 'mkdir -p /tmp/foo'; } \
&& { sh -lc 'echo "Hello world" > /tmp/foo/bar'; } \
Expand Down

0 comments on commit 34b16d6

Please sign in to comment.