CircleCI deploy looks successful, but exits with code 1?

Viewed 1743

I have a circleci configuration that runs a script to deploy a storybook site. It's essentially cding into my frontend monorepo packages, running yarn install, builds the storybook and syncs it to an S3 bucket.

(redacting a few things like names of packages and files)

It starts a with job within my circle's config file:

deploy-package-storybook:
    <<: *defaults
    working_directory: ~/root

    steps:
      - checkout
      - <<: *install_aws
      - attach_workspace:
          at: ~/
      - run:
          name: Deploy Storybook
          command: |
            ~/root/bin/deploy-storybook.sh PACKAGE

The script looks like this:

echo "${CYAN}deploying storybook\n"
cd packages/${TAG}
yarn build-storybook
aws s3 sync ./artifacts/storybook s3://storybook.website.us/${TAG} --delete || slack_alert storybook-deploy-fail
slack_alert "deploy-storybook-success"

When it runs in Circle, it seemingly finishes syncing and even sends a slack alert to my channel that it successfully deploys, but however at the end of it, it shows this:

upload: artifacts/storybook/vendors~main.8c562e1c344f6a5f2073.bundle.js to s3://storybook.website.us/package/vendors~main.8c562e1c344f6a5f2073.bundle.js
0
ok

Exited with code exit status 1
CircleCI received exit code 1

However I'm not entirely sure why it does this. It's successfully synced, so it should pass, right?

Things I've done:

I've tried adding a --debug flag to aws s3 sync like so:

aws s3 sync ./artifacts/storybook s3://storybook.website.us/${TAG} --delete --debug

and it returns with something like this:

2020-03-16 13:14:28,349 - ThreadPoolExecutor-0_2 - botocore.hooks - DEBUG - Event needs-retry.s3.PutObject: calling handler <botocore.retryhandler.RetryHandler object at 0x7fcc35212dd0>
2020-03-16 13:14:28,349 - ThreadPoolExecutor-0_2 - botocore.retryhandler - DEBUG - No retry needed.
2020-03-16 13:14:28,350 - ThreadPoolExecutor-0_2 - botocore.hooks - DEBUG - Event needs-retry.s3.PutObject: calling handler <bound method S3RegionRedirector.redirect_from_error of <botocore.utils.S3RegionRedirector object at 0x7fcc35212e10>>
2020-03-16 13:14:28,350 - ThreadPoolExecutor-0_2 - botocore.hooks - DEBUG - Event after-call.s3.PutObject: calling handler <function enhance_error_msg at 0x7fcc35c79320>
2020-03-16 13:14:28,350 - ThreadPoolExecutor-0_2 - s3transfer.utils - DEBUG - Releasing acquire 34/None
upload: artifacts/storybook/vendors~main.5f43fbfd82bbe3ed3177.bundle.js to s3://storybook.website.us/package/vendors~main.5f43fbfd82bbe3ed3177.bundle.js
2020-03-16 13:14:28,365 - Thread-1 - awscli.customizations.s3.results - DEBUG - Shutdown request received in result processing thread, shutting down result thread.
0
ok

Exited with code exit status 1
CircleCI received exit code 1

This isn't my area of expertise, so I'm really lost on what to do with errors like these. Could someone please help?

0 Answers
Related