LoginSignup
2
1

More than 5 years have passed since last update.

jenkinsでAWS s3 で指定されたファイルがあるかを確認する

Posted at

AWS s3 で指定のファイルがあるかを確認したい

はじめ以下のコマンドで試してみる。
aws s3 ls s3://hoge/hoge.txt

ファイルが存在しない場合、return code 1を返しているようで上手くいかない。
ERROR: script returned exit code 1

jenkins でのshell 実行はデフォルトで
/bin/sh -xe
がついているよう。
-ereturn 0 以外が返ってきた場合に強制終了されてしまう。
なので以下のようにechoでラップしてあげると上手くいく。

 echoaws s3 ls s3://hoge/hoge.txt

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1