LoginSignup
1
1

More than 5 years have passed since last update.

ElasticBeanstalkのcontainer_commandで複数行のコマンドを使う

Last updated at Posted at 2018-05-06

YAMLブロックで普通にできた。

container_commands:
  # Remove all nginx site configuration
  10-greetings:
    command: |
      if [[ -f greetings.txt ]]; then
        cat greetings.txt
      else
        echo "no greetings file found"
      fi

できないと思ってたので以前は下記のようにしていたが、明らかに可読性は上記のほうが良い。

    command: "[[ -f greetings.txt ]] && cat greetings.txt || echo 'no greetings file found'"
1
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
1
1