Skip to content

Commit

Permalink
Backend - Docker build should fail on sample compilation failures (#1760
Browse files Browse the repository at this point in the history
)

Problem: Docker implicitly prepends "sh -c " to the RUN commands (no "-e"). Without "-e", the exit code of the shell script is the exit code of the last executed command. So the csample compilation script will only fail if the last sample failed the compilation.

Fix: Explicitly adding "set -e" to the command fixes the issue.

Fixes #1735
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Aug 8, 2019
1 parent 9a047fb commit 1407d86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY ./samples .
#I think it's better to just use a shell loop though.
#RUN for pipeline in $(find . -maxdepth 2 -name '*.py' -type f); do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done
#The "for" loop breaks on all whitespace, so we either need to override IFS or use the "read" command instead.
RUN find core -maxdepth 2 -name '*.py' -type f | while read pipeline; do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done
RUN set -e; find core -maxdepth 2 -name '*.py' -type f | while read pipeline; do dsl-compile --py "$pipeline" --output "$pipeline.tar.gz"; done

FROM debian:stretch

Expand Down

0 comments on commit 1407d86

Please sign in to comment.