2020年5月21日木曜日

ebコマンド for CircleCI

参照:



1)以下、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-regi2-dev --profile eb-cli
            eb deploy -v --staged --profile eb-cli

workflows:
  version: 2
  build-deploy:
    jobs:
      - deploy:
          filters:
            branches:
              only:
                - master
-----------------------------------------------------------------------


.gitignoreの中身
-----------------------------------------------------------------------
# Elastic Beanstalk Files
!.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
-----------------------------------------------------------------------


[githubの中身]

ポイント:
.circlrcibeanstalkの中身が同じ階層にいること!!


CircleCIの設定:
以下のAWSの認証設定を行うこと



0 件のコメント:

コメントを投稿

php log(ECS ログ出力)

# PHPエラーログの設定 ENV PHP_INI_DIR /usr/local/etc/php RUN { \ echo 'log_errors = On' ; \ echo 'error_log = /proc/self/...