AWSのelastic beanstalkで動かしている本番環境にデプロイしようとしたらエラーになった。
$ eb deploy
ERROR: This branch does not have a default environment. You must either specify an environment by typing "eb deploy my-env-name" or set a default environment by typing "eb use my-env-name".
これ、単純に自分がいまいるgitのブランチが間違っているだけ。
developブランチで eb deployしていたのを masterブランチに切り替えてからeb deployすればOK.
app rootのディレクトリに存在するbeanstalkの設定ファイル
./beanstalk/config.ymlによると branch-defaultsに記載さているブランチに移動してからでないとdeployできない感じみたいですね。
branch-defaults:
master:
environment: Appapi-env
environment-defaults:
Appapi-env:
branch: null
repository: null
global:
application_name: app-api
default_ec2_keyname: app-api
default_platform: Ruby 3.0 running on 64bit Amazon Linux 2
default_region: ap-northeast-1
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: app
sc: git
workspace_type: Application