Bash script does not generate artifact

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

   

目的

The purpose of this KB article is to provide potential reasons why this issue may occur and suggest troubleshooting steps to resolve it.

診断

  • You are executing a build that creates a file via the execution of a bash script, this file is then used to generate an artifact for the build
  • The file seems to be created within your build but it does not show up in the build teardown, and therefore is not considered as a generated artifact

原因

There are two likely causes behind the issue:

  1. The file is not actually being created by the bash script due to issues with the script
  2. The file is being created by the bash script, but the filename is incorrect due to improper formatting in the bash script

ソリューション

  1. As a first step, add the ls command in your YML configuration to your build step below the execution of your bash script to check that the artifact has actually been created and is present in the build directory:

    ls -l

    a) If the file is present, please proceed with Step 2
    b) If the file is not present, or is named something else - check your bash script and correct any issues that may be present to allow for the creation of that file with the correct filename.

  2. Test the bash script locally on your machine to verify the file that is generated outside of the Pipelines build environment.
    a) If the generated file is named differently to what is present in your build logs, please proceed with Step 3.
    b) If the file is the same as your build logs, please contact support or raise a community ticket for further assistance.

  3. Download and install the ShellCheck utility to scan the bash script that is being used in your build to validate it for errors.
    a) If there are errors found in the formatting of the script (for example : improper carriage returns), please proceed with Step 4.
    b) If there are no errors found, please contact support or raise a community ticket for further assistance.

  4. Proceed with executing the suggested command(s) found in the ShellCheck results and push this corrected file back to your repository
    a) For example - the bash script is found to contain literal carriage returns that cannot be interpreted, the suggestion is to run the tr -d '\r' command:

    tr -d '\r' < script.sh > fixedscript.sh

If the above instructions do not assist in resolving the issue, please raise a support ticket or raise a community support ticket for further assistance with this.

説明 Bash script does not generate artifact
製品Bitbucket Cloud
最終更新日: 2024 年 1 月 22 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.