aps1027 / laravel-vue-circleci-aws-eb

This is Sample Laravel Automation App by using circleci and aws elastic beanstalk.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Vue Circleci AWS Elastic Beanstalk

alt text

Life Cycle

  1. Do code changes
  2. Commit and push code changes to GitHub
  3. trigger code changes automatically via CircleCI and start testing (like UT and FT)
  4. Start deployment on AWS after testing success

Tools

  1. Docker for Containerization
  2. GitHub for Source Vesion Control
  3. CircleCI for CI/CD tool
  4. AWS services (Elastic Beanstalk)

Prerequisites

  1. install docker
  2. install docker-compose

Local Project Setup

  1. start docker-compose

    $ docker-compose up -d
    
  2. create .env file

    $ cp laravel/.env.example laravel/.env
    
  3. install composer

    $ docker-compose exec php-fpm composer install
    
  4. db migrate and seed

    $ docker-compose exec php-fpm php artisan migrate --seed
    
  5. passport install

    $ docker-compose exec php-fpm php artisan passport:install
    
  6. link to storage

    $ docker-compose exec php-fpm php artisan storage:link
    
  7. give root permission to storage(Only for linux user)

    $ docker-compose exec php-fpm sh 
    $ cd storage && chown -R www-data:www-data *
    $ exit
    
  8. watch vue changes

    $ docker-compose exec php-fpm yarn install 
    $ docker-compose exec php-fpm yarn watch
    
  9. access localhost:8000

Automatic Deploy

Elastic Beanstalk

  1. create application with name laravel-vue-circleci and LaravelVueCircleci-env
  2. select docker environment and select 64bit amazon linux
  3. set mysql database in the following: alt text alt text
  4. after creation env: alt text alt text
  5. add environment variables: alt text

CircleCI

  1. set up project laravel-vue-circleci-aws-eb alt text
  2. select existed config file alt text
  3. set AWS_Environment_Variables alt text
  4. do code changes, commit and push
  5. after, test-build-deploy will be success alt text

Check your code change apply or not by accessing <elastic beanstalk url>.

About

This is Sample Laravel Automation App by using circleci and aws elastic beanstalk.


Languages

Language:PHP 56.2%Language:Blade 28.4%Language:Vue 14.4%Language:Dockerfile 1.0%