There is a problem when the command result is asynchronous. It will return a error of a non-zero code
So, How do I separate them that can be execute one by one.
COPY --from=builder /app/src/environments/env.sh /home
WORKDIR /home
RUN cd /home && source env.sh \
&& sentry-cli releases new $VERSION \
&& sentry-cli releases set-commits --auto $VERSION \
&& sentry-cli releases files $VERSION upload-sourcemaps . \
&& sentry-cli releases finalize $VERSION
Particularly, sentry-cli releases files $VERSION upload-sourcemaps
is an upload command.