参照先:
1)AWSElasticBeanstalkFullAccessを選択
2)次のステップを押す
3)ユーザー作成を押す
4)アクセスーIDとシークレットアクセスキーを控える
5)以下にaccess_idとsecret_access_keyを入力する
~/.aws/credentials
Install eb cli:
導入済みであれば、割愛
pip install --upgrade --user awsebcli
CircleCI:
.circleci/config.yml
-----------------------------------------------------------------------------
version: 2
jobs:
deploy:
docker:
- image: circleci/python:2.7
working_directory: ~/repo
steps:
- checkout
- run:
name: Install awscli
command: |
sudo pip install awsebcli --upgrade
- run:
name: Create AWS credentials manually
command: |
mkdir ~/.aws
touch ~/.aws/config
chmod 600 ~/.aws/config
echo "[profile eb-cli]" > ~/.aws/config
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" >> ~/.aws/config
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" >> ~/.aws/config
- run:
name: Deploy to EB if branch is Master
command: |
eb use test-eb --profile eb-cli
eb deploy -v --staged --profile eb-cli
workflows:
version: 2
build-deploy:
jobs:
- deploy:
filters:
branches:
only:
- master
- develop
-----------------------------------------------------------------------------------
0 件のコメント:
コメントを投稿