1

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.

From Gitlab Example

Collin Barrett
  • 2,441
  • 5
  • 32
  • 53
Eriice
  • 147
  • 1
  • 7
  • 1
    Separate commands by semicolon. – fiveelements Jul 28 '19 at 11:42
  • They _should_ run sequentially – the shell `&&` operator waits for the previous command to execute and runs the next command only if its exit status is 0. If your `upload-sourcemaps` command is asynchronous (it starts the upload in the background and returns immediately) the shell has no direct way to wait for it. – David Maze Jul 28 '19 at 19:35
  • So, what you really need? Want to continue next command only if `async command finish` or `the async command return non-zero make you docker build issue`? – atline Jul 29 '19 at 03:27

0 Answers0