When you sign up for Circle CI, some repositories are displayed, so select it. Select to run the build.
Select the registered repository from BUILDS and select Project Settings in the upper right.
Go to PERMISSIONS → AWS Permissions and register your Access Key ID and Secret Access Key ID.
This is internally written to ~ / .aws / config
and ~ / .aws / credentials
at build time.
The profile name will be [default]
, so be careful if you have already edited the .config file under the .elasticbeanstalk directory with a different profile name.
Get the WebHook URL and go to Circle CI. Check with Test Hook.
Maybe I had to put it directly under the repository root directory.
Not required if the source code is in the root directory of the repository.
general:
build_dir: src
According to the Python3 environment that can be created with Elastic Beanstalk now, as follows.
machine:
python:
version: 3.4.3
Dependent libraries are also included here.
dependencies:
pre:
- pip install -r requirements.txt
- pip install awsebcli
As below
test:
override:
- python test.py
The branch name and the environment name on Elastic Beanstalk.
deployment:
staging:
branch: develop
commands:
- eb deploy eb-environment-name
Add .elasticbeanstalk / config.yml
to the deploy directory (src this time).
Edit as follows.
As mentioned above, the profile name is default
.
branch-defaults:
default:
environment: eb-environment-name
global:
application_name: eb-app-name
default_ec2_keyname: null
default_platform: 64bit Amazon Linux 2016.03 v2.1.0 running Python 3.4
default_region: ap-northeast-1
profile: default
sc: null
You can overwrite ~ / .aws / credentials
with pre
in circle.yml
.
At first, I wrote it out by myself without noticing that ~ / .aws / credentials
was written out on the Circle CI side, so this method should be okay.
Push circle.yml
and .elasticbeanstalk / config.yml
.
It should be deployed after a while.
Recommended Posts