title: CircleCI deploy looks successful, but exits with code 1?
body: <p>I have a circleci configuration that runs a script to deploy a storybook site. It's essentially <code>cd</code>ing into my frontend monorepo packages, running <code>yarn install</code>, builds the storybook and syncs it to an S3 bucket.</p>
  <p><em>(redacting a few things like names of packages and files)</em></p>
  <p>It starts a with job within my circle's config file:</p>
  <pre class="lang-yaml prettyprint-override"><code>deploy-package-storybook:
      &lt;&lt;: *defaults
      working_directory: ~/root
  
      steps:
        - checkout
        - &lt;&lt;: *install_aws
        - attach_workspace:
            at: ~/
        - run:
            name: Deploy Storybook
            command: |
              ~/root/bin/deploy-storybook.sh PACKAGE
  </code></pre>
  <p>The script looks like this:</p>
  <pre class="lang-sh prettyprint-override"><code>echo &quot;${CYAN}deploying storybook\n&quot;
  cd packages/${TAG}
  yarn build-storybook
  aws s3 sync ./artifacts/storybook s3://storybook.website.us/${TAG} --delete || slack_alert storybook-deploy-fail
  slack_alert &quot;deploy-storybook-success&quot;
  </code></pre>
  <p>When it runs in Circle, it <em>seemingly</em> 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:</p>
  <pre class="lang-sh prettyprint-override"><code>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
  </code></pre>
  <p>However I'm not entirely sure <em>why</em> it does this. It's successfully synced, so it <em>should</em> pass, right?</p>
  <p><strong>Things I've done:</strong></p>
  <p>I've tried adding a <code>--debug</code> flag to <code>aws s3 sync</code> like so:</p>
  <pre class="lang-sh prettyprint-override"><code>aws s3 sync ./artifacts/storybook s3://storybook.website.us/${TAG} --delete --debug
  </code></pre>
  <p>and it returns with something like this:</p>
  <pre class="lang-sh prettyprint-override"><code>2020-03-16 13:14:28,349 - ThreadPoolExecutor-0_2 - botocore.hooks - DEBUG - Event needs-retry.s3.PutObject: calling handler &lt;botocore.retryhandler.RetryHandler object at 0x7fcc35212dd0&gt;
  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 &lt;bound method S3RegionRedirector.redirect_from_error of &lt;botocore.utils.S3RegionRedirector object at 0x7fcc35212e10&gt;&gt;
  2020-03-16 13:14:28,350 - ThreadPoolExecutor-0_2 - botocore.hooks - DEBUG - Event after-call.s3.PutObject: calling handler &lt;function enhance_error_msg at 0x7fcc35c79320&gt;
  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
  </code></pre>
  <p>This isn't my area of expertise, so I'm really lost on what to do with errors like these. Could someone please help?</p>