From 55ac87405f57fcea4079470e46d49e9d69eba3f6 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 09:35:16 +0800
Subject: [PATCH 01/14] Pre-deploy workflow defined
---
.github/ISSUE_TEMPLATE/1.bug_report.md | 32 ++++++++++++++++++++
.github/ISSUE_TEMPLATE/2.feature_request.md | 22 ++++++++++++++
.github/PULL_REQUEST_TEMPLATE.md | 19 ++++++++++++
.github/scripts/decrypt_secret.sh | 4 +++
.github/secrets/.env.development.gpg | Bin 0 -> 760 bytes
.github/workflows/pre-deploy.yml | 31 +++++++++++++++++++
6 files changed, 108 insertions(+)
create mode 100644 .github/ISSUE_TEMPLATE/1.bug_report.md
create mode 100644 .github/ISSUE_TEMPLATE/2.feature_request.md
create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
create mode 100644 .github/scripts/decrypt_secret.sh
create mode 100644 .github/secrets/.env.development.gpg
create mode 100644 .github/workflows/pre-deploy.yml
diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.md b/.github/ISSUE_TEMPLATE/1.bug_report.md
new file mode 100644
index 0000000..e264abe
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1.bug_report.md
@@ -0,0 +1,32 @@
+---
+name: 🐞Bug report
+about: Create a report to help us improve
+---
+
+## Description
+
+A clear and concise description of what the bug is.
+
+## Steps to Reproduce
+
+1. Go to '...'
+2. Run '...'
+3. See error
+
+## Expected behavior
+
+A clear and concise description of what you expected to happen.
+
+## Screenshots
+
+If applicable, add screenshots to help explain your problem.
+
+## System Information
+
+- Laravel version: #.#.#
+- PHP version: #.#.#
+- Database version: #.#.#
+
+## Additional context
+
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.md b/.github/ISSUE_TEMPLATE/2.feature_request.md
new file mode 100644
index 0000000..d96c1ba
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2.feature_request.md
@@ -0,0 +1,22 @@
+---
+name: 💡Feature request
+about: Suggest an idea for this project
+---
+
+# Feature request
+
+## Is your feature request related to a problem? Please describe.
+
+A clear and concise description of what you want and what your use case is.
+
+## Describe the solution you'd like
+
+A clear and concise description of what you want to happen.
+
+## Describe alternatives you've considered
+
+A clear and concise description of any alternative solutions or features you've considered.
+
+## Additional context
+
+Add any other context or screenshots about the feature request here.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..64bfb45
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,19 @@
+# Description
+
+A very descriptive paragraph that provide details regarding your pull request.
+
+## Added
+
+-
+
+## Modified
+
+-
+
+## Fixed
+
+-
+
+## Refactored
+
+-
diff --git a/.github/scripts/decrypt_secret.sh b/.github/scripts/decrypt_secret.sh
new file mode 100644
index 0000000..e75b2e0
--- /dev/null
+++ b/.github/scripts/decrypt_secret.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+# --batch to prevent interactive command --yes to assume "yes" for questions
+gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output .env .github/secrets/.env.$APP_ENV.gpg
\ No newline at end of file
diff --git a/.github/secrets/.env.development.gpg b/.github/secrets/.env.development.gpg
new file mode 100644
index 0000000000000000000000000000000000000000..99472ca3b0b68de3d732c5e06a4d5c8ff84d3ed4
GIT binary patch
literal 760
zcmV0R*7?j6Bk{GeDS+h%x|Fz6>Op*sb^4rqQ9K
z%Dl(+vc+YY*Ri8UcIxpHSos1(W5@?ef{dZvqdw@A_}!FBk#VRn`s8UhQYt)^5cQ2o
z;^PKU;p_+Nx6eQJoSBCU`(EWUVaB8G$W6ijc9iKa6CwWrbhJNy`_H+@!8Fos3Ebs$
znfR!iL!+ai=do9)n=NvSkBrdOw=`vz{C#55(0DsrXcJrLBN~iqSi{G7c!C2yRyE|n
zV1YjLTVsT~6ZyG#B3XP_<7ZqzL5wQjW(_|XAdlwf`x*u#)*e
zr(7?PLp^ioOrDa$CWD$(i^3(uQ(bW;`zC>2W0VMUAiunMSqW$}dJ|5{{S}5{u)nYM
z%^piGW*Txc+)Cvgr0IJDTo!zp{xxgeU3A8n^(t%tj_{%1*KI
z+&2fN_-^0GKC~-D+^fp=z$M;S!evn@@4YUjvGg8*J9`$C89^)--><8u91dpL>TEdo
z!fu8ht2!WSrVZ~L@or8N9+vTY(uYz)
z++Ya046P!3m;;-c5gL-H98=l9^Ogj!izo^`5PI%XBln)lOd>1OH?L*tgqV~1Lvk{6(!3NH2T(@ya2QtDg%F<}?K(t_r
q4B`-%na
Date: Tue, 1 Oct 2019 09:36:39 +0800
Subject: [PATCH 02/14] Replaced phpunit/phpunit with brianium/paratest
---
composer.json | 6 +--
composer.lock | 106 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 108 insertions(+), 4 deletions(-)
diff --git a/composer.json b/composer.json
index a257831..6d9fa27 100755
--- a/composer.json
+++ b/composer.json
@@ -27,13 +27,13 @@
"valorin/pwned-validator": "^1.2"
},
"require-dev": {
+ "brianium/paratest": "^3.0",
"codedungeon/phpunit-result-printer": "^0.26.1",
"facade/ignition": "^1.9",
"filp/whoops": "^2.0",
"friendsofphp/php-cs-fixer": "^2.14",
"mockery/mockery": "^1.0",
- "nunomaduro/collision": "^3.0",
- "phpunit/phpunit": "^8.0"
+ "nunomaduro/collision": "^3.0"
},
"autoload": {
"classmap": [
@@ -59,7 +59,7 @@
},
"scripts": {
"test": [
- "vendor/bin/phpunit"
+ "vendor/bin/paratest"
],
"format": [
"vendor/bin/php-cs-fixer fix ."
diff --git a/composer.lock b/composer.lock
index ae24f1e..f2721d8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "473d695571c5c1122236b1c246af9cdb",
+ "content-hash": "05d447bf9c8c7b2ab50e336ced1b17c2",
"packages": [
{
"name": "aws/aws-sdk-php",
@@ -4148,6 +4148,110 @@
],
"time": "2015-03-06T12:14:28+00:00"
},
+ {
+ "name": "brianium/habitat",
+ "version": "v1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/brianium/habitat.git",
+ "reference": "d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/brianium/habitat/zipball/d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96",
+ "reference": "d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96",
+ "shasum": ""
+ },
+ "require-dev": {
+ "monolog/monolog": ">=1.5.0",
+ "phpunit/phpunit": ">=3.7.21"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Habitat": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Brian",
+ "email": "scaturrob@gmail.com",
+ "homepage": "http://brianscaturro.com",
+ "role": "Lead"
+ }
+ ],
+ "description": "A dependable php environment",
+ "time": "2013-06-08T04:42:29+00:00"
+ },
+ {
+ "name": "brianium/paratest",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/paratestphp/paratest.git",
+ "reference": "0300c7ca8e8990b026371c03ff4f225ca894f0c5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/paratestphp/paratest/zipball/0300c7ca8e8990b026371c03ff4f225ca894f0c5",
+ "reference": "0300c7ca8e8990b026371c03ff4f225ca894f0c5",
+ "shasum": ""
+ },
+ "require": {
+ "brianium/habitat": "1.0.0",
+ "composer/semver": "~1.2",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-simplexml": "*",
+ "php": "^7.2",
+ "phpunit/php-code-coverage": "^7.0.2",
+ "phpunit/php-timer": "^2.0",
+ "phpunit/phpunit": "^8.0",
+ "symfony/console": "^3.4|^4.0",
+ "symfony/process": "^3.4|^4.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.3.2"
+ },
+ "bin": [
+ "bin/paratest"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "ParaTest\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Brian Scaturro",
+ "email": "scaturrob@gmail.com",
+ "homepage": "http://brianscaturro.com",
+ "role": "Lead"
+ }
+ ],
+ "description": "Parallel testing for PHP",
+ "homepage": "https://github.com/paratestphp/paratest",
+ "keywords": [
+ "concurrent",
+ "parallel",
+ "phpunit",
+ "testing"
+ ],
+ "time": "2019-02-18T04:57:44+00:00"
+ },
{
"name": "codedungeon/php-cli-colors",
"version": "1.10.7",
From 704b1b91953a70c428c13dbb7f06d6dcad1a2bc1 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 09:49:07 +0800
Subject: [PATCH 03/14] wip
---
.github/scripts/decrypt_secret.sh | 2 +-
.github/secrets/.env.development.gpg | Bin 760 -> 0 bytes
.github/secrets/.env.gpg | 2 ++
.github/workflows/main.yml | 36 +++++++++++++++++++++++++++
.github/workflows/pre-deploy.yml | 4 +--
readme.md | 8 ++++++
6 files changed, 48 insertions(+), 4 deletions(-)
delete mode 100644 .github/secrets/.env.development.gpg
create mode 100644 .github/secrets/.env.gpg
create mode 100644 .github/workflows/main.yml
diff --git a/.github/scripts/decrypt_secret.sh b/.github/scripts/decrypt_secret.sh
index e75b2e0..517016d 100644
--- a/.github/scripts/decrypt_secret.sh
+++ b/.github/scripts/decrypt_secret.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# --batch to prevent interactive command --yes to assume "yes" for questions
-gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output .env .github/secrets/.env.$APP_ENV.gpg
\ No newline at end of file
+gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" --output .env .github/secrets/.env.gpg
\ No newline at end of file
diff --git a/.github/secrets/.env.development.gpg b/.github/secrets/.env.development.gpg
deleted file mode 100644
index 99472ca3b0b68de3d732c5e06a4d5c8ff84d3ed4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 760
zcmV0R*7?j6Bk{GeDS+h%x|Fz6>Op*sb^4rqQ9K
z%Dl(+vc+YY*Ri8UcIxpHSos1(W5@?ef{dZvqdw@A_}!FBk#VRn`s8UhQYt)^5cQ2o
z;^PKU;p_+Nx6eQJoSBCU`(EWUVaB8G$W6ijc9iKa6CwWrbhJNy`_H+@!8Fos3Ebs$
znfR!iL!+ai=do9)n=NvSkBrdOw=`vz{C#55(0DsrXcJrLBN~iqSi{G7c!C2yRyE|n
zV1YjLTVsT~6ZyG#B3XP_<7ZqzL5wQjW(_|XAdlwf`x*u#)*e
zr(7?PLp^ioOrDa$CWD$(i^3(uQ(bW;`zC>2W0VMUAiunMSqW$}dJ|5{{S}5{u)nYM
z%^piGW*Txc+)Cvgr0IJDTo!zp{xxgeU3A8n^(t%tj_{%1*KI
z+&2fN_-^0GKC~-D+^fp=z$M;S!evn@@4YUjvGg8*J9`$C89^)--><8u91dpL>TEdo
z!fu8ht2!WSrVZ~L@or8N9+vTY(uYz)
z++Ya046P!3m;;-c5gL-H98=l9^Ogj!izo^`5PI%XBln)lOd>1OH?L*tgqV~1Lvk{6(!3NH2T(@ya2QtDg%F<}?K(t_r
q4B`-%na*LuB) d9)HnY!v}}`o?>袓E^p- rVh*zN +P^̅l~t5ltm N^<
/#v|qCAv$02kpmzަhgQxλ1Ek;eЅaQSS6+ģVD`ت }pD&n!J\a4֮Uѵ!JTi
pUFvB*bUhv3@(8?"_ oؼrByE0APy;aϔtڍ72HD@e{h'"mI U)F/Gt~>?llCo
+LN"zj:?`9Hdu9kҸۙhϱ3
\ No newline at end of file
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..29ff458
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,36 @@
+name: Actions
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ Build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v1
+
+ - name: Decrypt configuration file
+ run: sh ./.github/scripts/decrypt_secret.sh
+ env:
+ SECRET_PASSPHRASE: ${{secrets.SECRET_PASSPHRASE}}
+
+ - name: Install PHP dependencies
+ run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
+
+ - name: Install Node.js dependencies
+ run: npm install
+
+ - name: Run the test suite
+ run: ./vendor/bin/paratest
+
+ - name: Archive snapshot
+ run: zip -r snapshot.zip ./
+
+ - name: Upload snapshot
+ uses: actions/upload-artifact@master
+ with:
+ name: snapshot
+ path: snapshot.zip
diff --git a/.github/workflows/pre-deploy.yml b/.github/workflows/pre-deploy.yml
index d78add7..f4d0af5 100644
--- a/.github/workflows/pre-deploy.yml
+++ b/.github/workflows/pre-deploy.yml
@@ -5,7 +5,6 @@ on:
branches:
- "*"
- "*/*"
- - "!develop"
- "!master"
jobs:
@@ -18,8 +17,7 @@ jobs:
- name: Decrypt configuration file
run: sh ./.github/scripts/decrypt_secret.sh
env:
- APP_ENV: development
- SECRET_PASSPHRASE: ${{secrets.SECRET_PASSPHRASE_DEVELOP}}
+ SECRET_PASSPHRASE: ${{secrets.SECRET_PASSPHRASE}}
- name: Install PHP dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
diff --git a/readme.md b/readme.md
index 3c7370d..3fc4220 100755
--- a/readme.md
+++ b/readme.md
@@ -4,6 +4,14 @@ This is a scaffolding project that comes with authentication &
users CRUD. It is a Single Page Application (SPA) built on top of [React.js](https://reactjs.org)
in the frontend & [Laravel](https://laravel.com) in the backend.
+
+
+
+
+
+
+## Screenshots
+
[](https://github.com/palonponjovertlota/laravel-react-admin)
[](https://github.com/palonponjovertlota/laravel-react-admin)
From 0862f84fa582e75ac4c3c56e4603f685192eb9f5 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:04:29 +0800
Subject: [PATCH 04/14] wip
---
.github/workflows/main.yml | 27 ++++++++++++++++++++-------
.github/workflows/pre-deploy.yml | 1 +
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 29ff458..c4c26d8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,9 +4,10 @@ on:
push:
branches:
- master
+ - feature/*
jobs:
- Build:
+ Build & Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -26,11 +27,23 @@ jobs:
- name: Run the test suite
run: ./vendor/bin/paratest
- - name: Archive snapshot
- run: zip -r snapshot.zip ./
+ - name: Login
+ uses: actions/heroku@master
+ env:
+ HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
+ with:
+ args: container:login
+
+ - name: Push
+ uses: actions/heroku@master
+ env:
+ HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
+ with:
+ args: container:push -a laravel-react-admin web
- - name: Upload snapshot
- uses: actions/upload-artifact@master
+ - name: Release
+ uses: actions/heroku@master
+ env:
+ HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- name: snapshot
- path: snapshot.zip
+ args: container:release -a laravel-react-admin web
\ No newline at end of file
diff --git a/.github/workflows/pre-deploy.yml b/.github/workflows/pre-deploy.yml
index f4d0af5..dd3d7c0 100644
--- a/.github/workflows/pre-deploy.yml
+++ b/.github/workflows/pre-deploy.yml
@@ -6,6 +6,7 @@ on:
- "*"
- "*/*"
- "!master"
+ - "!feature/*"
jobs:
Test:
From 346477a87ef7592b8c29c4474f44beee908de5d2 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:05:15 +0800
Subject: [PATCH 05/14] wip
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c4c26d8..ae3fdc4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,7 +7,7 @@ on:
- feature/*
jobs:
- Build & Deploy:
+ Build-Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
From 04eb945c210600e4eaace04b81cd983c92f6b256 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:12:14 +0800
Subject: [PATCH 06/14] wip
---
Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 Dockerfile
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..ace57e5
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,54 @@
+FROM php:7.3-fpm
+
+ENV MASTER_TZ=Asia/Manila
+ENV MASTER_DIR=/var/www/html
+
+RUN ln -snf /usr/share/zoneinfo/${MASTER_TZ} /etc/localtime && echo ${MASTER_TZ} > /etc/timezone
+
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ curl \
+ git \
+ jpegoptim optipng pngquant gifsicle \
+ libfreetype6-dev \
+ libjpeg62-turbo-dev \
+ libpng-dev \
+ libzip-dev \
+ locales \
+ mysql-client \
+ unzip \
+ vim \
+ zip
+
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+
+RUN docker-php-ext-install bcmath exif mbstring pcntl pdo_mysql zip && \
+ docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
+ docker-php-ext-install gd
+
+# This will override default PHP configuration
+COPY .docker/php-fpm/php.ini /usr/local/etc/php/conf.d/local.ini:ro
+
+RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
+
+# This will allow the container to use a cached version of PHP packages
+COPY composer.lock composer.json ${MASTER_DIR}/
+
+# This is included just to bypass errors thrown by composer scripts
+COPY database ${MASTER_DIR}/database
+
+RUN composer install --no-interaction --no-plugins --no-scripts
+
+COPY . ${MASTER_DIR}
+COPY ./.docker/php-fpm/init.sh /usr/local/bin/init
+COPY ./.docker/php-fpm/after.sh /usr/local/bin/after
+COPY ./.docker/queuer/init.sh /usr/local/bin/laravel-queuer
+COPY ./.docker/scheduler/init.sh /usr/local/bin/laravel-scheduler
+
+RUN chmod -R 775 ${MASTER_DIR}/storage ${MASTER_DIR}/bootstrap/cache
+RUN chmod u+x /usr/local/bin/init
+RUN chmod u+x /usr/local/bin/after
+RUN chmod u+x /usr/local/bin/laravel-queuer
+RUN chmod u+x /usr/local/bin/laravel-scheduler
+
+ENTRYPOINT ["init", "--port", "9000"]
\ No newline at end of file
From 4c4da6338f3593d1e47232c8b3a8b330b6c26eed Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:43:18 +0800
Subject: [PATCH 07/14] Revamed docker setup
---
.docker/db/.gitkeep | 0
.docker/php-fpm/Dockerfile | 54 -------------------
.docker/php-fpm/after.sh | 5 --
.docker/php-fpm/init.sh | 3 --
.docker/webserver/Dockerfile | 5 --
.dockerignore | 2 -
.gitignore | 1 -
Dockerfile | 20 ++-----
docker-compose.dev.yml | 40 --------------
docker-compose.prod.yml | 26 ---------
docker-compose.yml | 28 ++++++++--
.../nginx.conf.example => nginx.conf | 4 +-
.docker/php-fpm/php.ini => php.ini | 0
readme.md | 10 ++--
.docker/queuer/init.sh => scripts/queuer.sh | 0
.../scheduler/init.sh => scripts/scheduler.sh | 0
16 files changed, 33 insertions(+), 165 deletions(-)
delete mode 100644 .docker/db/.gitkeep
delete mode 100644 .docker/php-fpm/Dockerfile
delete mode 100644 .docker/php-fpm/after.sh
delete mode 100644 .docker/php-fpm/init.sh
delete mode 100644 .docker/webserver/Dockerfile
delete mode 100644 docker-compose.dev.yml
delete mode 100644 docker-compose.prod.yml
rename .docker/webserver/nginx.conf.example => nginx.conf (91%)
rename .docker/php-fpm/php.ini => php.ini (100%)
rename .docker/queuer/init.sh => scripts/queuer.sh (100%)
rename .docker/scheduler/init.sh => scripts/scheduler.sh (100%)
diff --git a/.docker/db/.gitkeep b/.docker/db/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/.docker/php-fpm/Dockerfile b/.docker/php-fpm/Dockerfile
deleted file mode 100644
index ace57e5..0000000
--- a/.docker/php-fpm/Dockerfile
+++ /dev/null
@@ -1,54 +0,0 @@
-FROM php:7.3-fpm
-
-ENV MASTER_TZ=Asia/Manila
-ENV MASTER_DIR=/var/www/html
-
-RUN ln -snf /usr/share/zoneinfo/${MASTER_TZ} /etc/localtime && echo ${MASTER_TZ} > /etc/timezone
-
-RUN apt-get update && apt-get install -y \
- build-essential \
- curl \
- git \
- jpegoptim optipng pngquant gifsicle \
- libfreetype6-dev \
- libjpeg62-turbo-dev \
- libpng-dev \
- libzip-dev \
- locales \
- mysql-client \
- unzip \
- vim \
- zip
-
-RUN apt-get clean && rm -rf /var/lib/apt/lists/*
-
-RUN docker-php-ext-install bcmath exif mbstring pcntl pdo_mysql zip && \
- docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ && \
- docker-php-ext-install gd
-
-# This will override default PHP configuration
-COPY .docker/php-fpm/php.ini /usr/local/etc/php/conf.d/local.ini:ro
-
-RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
-# This will allow the container to use a cached version of PHP packages
-COPY composer.lock composer.json ${MASTER_DIR}/
-
-# This is included just to bypass errors thrown by composer scripts
-COPY database ${MASTER_DIR}/database
-
-RUN composer install --no-interaction --no-plugins --no-scripts
-
-COPY . ${MASTER_DIR}
-COPY ./.docker/php-fpm/init.sh /usr/local/bin/init
-COPY ./.docker/php-fpm/after.sh /usr/local/bin/after
-COPY ./.docker/queuer/init.sh /usr/local/bin/laravel-queuer
-COPY ./.docker/scheduler/init.sh /usr/local/bin/laravel-scheduler
-
-RUN chmod -R 775 ${MASTER_DIR}/storage ${MASTER_DIR}/bootstrap/cache
-RUN chmod u+x /usr/local/bin/init
-RUN chmod u+x /usr/local/bin/after
-RUN chmod u+x /usr/local/bin/laravel-queuer
-RUN chmod u+x /usr/local/bin/laravel-scheduler
-
-ENTRYPOINT ["init", "--port", "9000"]
\ No newline at end of file
diff --git a/.docker/php-fpm/after.sh b/.docker/php-fpm/after.sh
deleted file mode 100644
index 74d6730..0000000
--- a/.docker/php-fpm/after.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-if [ "$PHP_ENV" != "development" ]; then
- chown -R www-data /var/www/html
-fi
\ No newline at end of file
diff --git a/.docker/php-fpm/init.sh b/.docker/php-fpm/init.sh
deleted file mode 100644
index d7cc492..0000000
--- a/.docker/php-fpm/init.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-
-exec php-fpm
\ No newline at end of file
diff --git a/.docker/webserver/Dockerfile b/.docker/webserver/Dockerfile
deleted file mode 100644
index ef438bb..0000000
--- a/.docker/webserver/Dockerfile
+++ /dev/null
@@ -1,5 +0,0 @@
-FROM nginx:alpine
-
-COPY .docker/webserver/nginx.conf /etc/nginx/conf.d/nginx.conf
-
-COPY . /var/www/html
\ No newline at end of file
diff --git a/.dockerignore b/.dockerignore
index 0cb44d8..98fe7e2 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,7 +1,5 @@
.git
.idea
-node_modules
-vendor
storage/framework/cache/**
storage/framework/sessions/**
storage/framework/views/**
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 35266e9..a432f83 100755
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@ public/css/*
public/js/*
.php_cs.cache
dump.sql
-nginx.conf
/node_modules
/public/hot
/public/storage
diff --git a/Dockerfile b/Dockerfile
index ace57e5..9a60ef1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,6 @@ RUN apt-get update && apt-get install -y \
libpng-dev \
libzip-dev \
locales \
- mysql-client \
unzip \
vim \
zip
@@ -27,28 +26,17 @@ RUN docker-php-ext-install bcmath exif mbstring pcntl pdo_mysql zip && \
docker-php-ext-install gd
# This will override default PHP configuration
-COPY .docker/php-fpm/php.ini /usr/local/etc/php/conf.d/local.ini:ro
-
-RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
-# This will allow the container to use a cached version of PHP packages
-COPY composer.lock composer.json ${MASTER_DIR}/
+COPY php.ini /usr/local/etc/php/conf.d/local.ini:ro
# This is included just to bypass errors thrown by composer scripts
COPY database ${MASTER_DIR}/database
-RUN composer install --no-interaction --no-plugins --no-scripts
-
COPY . ${MASTER_DIR}
-COPY ./.docker/php-fpm/init.sh /usr/local/bin/init
-COPY ./.docker/php-fpm/after.sh /usr/local/bin/after
-COPY ./.docker/queuer/init.sh /usr/local/bin/laravel-queuer
-COPY ./.docker/scheduler/init.sh /usr/local/bin/laravel-scheduler
+COPY scripts/queuer.sh /usr/local/bin/laravel-queuer
+COPY scripts/scheduler.sh /usr/local/bin/laravel-scheduler
RUN chmod -R 775 ${MASTER_DIR}/storage ${MASTER_DIR}/bootstrap/cache
-RUN chmod u+x /usr/local/bin/init
-RUN chmod u+x /usr/local/bin/after
RUN chmod u+x /usr/local/bin/laravel-queuer
RUN chmod u+x /usr/local/bin/laravel-scheduler
-ENTRYPOINT ["init", "--port", "9000"]
\ No newline at end of file
+EXPOSE 9000
\ No newline at end of file
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
deleted file mode 100644
index 5221f60..0000000
--- a/docker-compose.dev.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-version: '3'
-services:
- php-fpm:
- volumes:
- - ./:/var/www/html
- - ./.docker/php-fpm/php.ini:/usr/local/etc/php/conf.d/local.ini:ro
- environment:
- APP_ENV: 'development'
-
- scheduler:
- volumes:
- - ./:/var/www/html
-
- queuer:
- volumes:
- - ./:/var/www/html
-
- webserver:
- ports:
- - '80:80'
- - '443:443'
- volumes:
- - ./:/var/www/html
- - .docker/webserver/nginx.conf:/etc/nginx/conf.d/nginx.conf
-
- db:
- ports:
- - '3306:3306'
- environment:
- MYSQL_DATABASE: laravel-react-admin
- MYSQL_ROOT_PASSWORD: secret
- volumes:
- - ~/.laravel-react-admin-data:/var/lib/mysql
-
- db-admin:
- volumes:
- - ~/.laravel-react-admin-db-admin/sessions:/sessions
- environment:
- PMA_HOST: laravel-react-admin-db
- PMA_PORT: 3306
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
deleted file mode 100644
index 42a49d6..0000000
--- a/docker-compose.prod.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-version: '3'
-services:
- php-fpm:
- environment:
- APP_ENV: 'production'
-
- webserver:
- ports:
- - '80:80'
- - '443:443'
-
- db:
- ports:
- - '3306:3306'
- environment:
- MYSQL_DATABASE: laravel-react-admin
- MYSQL_ROOT_PASSWORD: secret
- volumes:
- - ~/.laravel-react-admin-data:/var/lib/mysql
-
- db-admin:
- volumes:
- - ~/.laravel-react-admin-db-admin/sessions:/sessions
- environment:
- PMA_HOST: laravel-react-admin-db
- PMA_PORT: 3306
diff --git a/docker-compose.yml b/docker-compose.yml
index 90a850a..01540a2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,7 +3,7 @@ services:
php-fpm:
build:
context: .
- dockerfile: ./.docker/php-fpm/Dockerfile
+ dockerfile: Dockerfile
image: laravel-react-admin-php-fpm
container_name: laravel-react-admin-php-fpm
working_dir: /var/www/html
@@ -19,6 +19,8 @@ services:
command: laravel-scheduler
env_file:
- .env
+ volumes:
+ - ./:/var/www/html
queuer:
image: laravel-react-admin-php-fpm
@@ -28,16 +30,22 @@ services:
command: laravel-queuer
env_file:
- .env
+ volumes:
+ - ./:/var/www/html
webserver:
- build:
- context: .
- dockerfile: ./.docker/webserver/Dockerfile
+ image: nginx:alpine
container_name: laravel-react-admin-webserver
working_dir: /var/www/html
restart: unless-stopped
depends_on:
- php-fpm
+ ports:
+ - '80:80'
+ - '443:443'
+ volumes:
+ - ./:/var/www/html
+ - ./nginx.conf:/etc/nginx/conf.d/nginx.conf
db:
image: mysql:5.7
@@ -45,6 +53,13 @@ services:
restart: unless-stopped
depends_on:
- php-fpm
+ ports:
+ - '3306:3306'
+ environment:
+ MYSQL_DATABASE: laravel-react-admin
+ MYSQL_ROOT_PASSWORD: secret
+ volumes:
+ - ~/.laravel-react-admin-data:/var/lib/mysql
db-admin:
image: phpmyadmin/phpmyadmin
@@ -54,3 +69,8 @@ services:
- db
links:
- db
+ volumes:
+ - ~/.laravel-react-admin-db-admin/sessions:/sessions
+ environment:
+ PMA_HOST: laravel-react-admin-db
+ PMA_PORT: 3306
diff --git a/.docker/webserver/nginx.conf.example b/nginx.conf
similarity index 91%
rename from .docker/webserver/nginx.conf.example
rename to nginx.conf
index e775a9a..ccc48b6 100644
--- a/.docker/webserver/nginx.conf.example
+++ b/nginx.conf
@@ -4,7 +4,7 @@ server {
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
- server_name example.com;
+ server_name laravel-react-admin.test;
client_max_body_size 25M;
location ~ \.php$ {
@@ -26,7 +26,7 @@ server {
server {
listen 80;
listen [::]:80;
- server_name phpmyadmin.example.com;
+ server_name phpmyadmin.laravel-react-admin.test;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
diff --git a/.docker/php-fpm/php.ini b/php.ini
similarity index 100%
rename from .docker/php-fpm/php.ini
rename to php.ini
diff --git a/readme.md b/readme.md
index 3fc4220..fb63794 100755
--- a/readme.md
+++ b/readme.md
@@ -64,10 +64,6 @@ Make sure that the address `127.0.0.1:80` usually `localhost` is available on th
To make this app run on **docker** you must add a custom host address pointing to `localhost` or `127.0.0.1`.
-### Add a virtual host
-
-A `nginx.conf.example` file is included inside `.docker/webserver` to help you in configuring a _virtual host_ according to your host setup. It is better to just rename it to `nginx.conf` to avoid the file being included in your version control system. **Nginx** will automatically pick up every changes to this configuration file because it is _bind-mounted_ into its container.
-
### You are good to go
You can now run the _image_ using the `docker-compose up` and optionally pass the `--build` flag if you intend to build the image. The app can be visited here `http:your_custom_host_address`.
@@ -82,7 +78,7 @@ You can run any artisan commands directly into the `laravel-react-admin-php-fpm`
### What about Browsersync?
-As we are bundling frontend assets with [webpack](https://webpack.js.org/) under the hood, you must specify the custom host address where the application runs in docker so that webpack can proxy that to be able to develop using docker. You can pass a `--env.proxy` flag when running for example the `npm run watch` command: `npm run watch -- --env.proxy=http:your_custom_host_address`.
+As we are bundling frontend assets with [webpack](https://webpack.js.org/) under the hood, you must specify the custom host address where the application runs in docker so that webpack can proxy that to be able to develop using docker. You can pass a `--env.proxy` flag when running for example the `npm run watch` command: `npm run watch -- --env.proxy=http:laravel-react-admin.test`.
### Using PhpMyAdmin
@@ -91,10 +87,10 @@ You could use **PhpMyAdmin** to browse your MySql database as it is included in
```
// /etc/hosts
-127.0.0.1 phpmyadmin.your_custom_host_address
+127.0.0.1 phpmyadmin.laravel-react-admin.test
```
-You could then visit **PhpMyAdmin** here: phpmyadmin.your_custom_host_address
+You could then visit **PhpMyAdmin** here: phpmyadmin.laravel-react-admin.test
## Testing
diff --git a/.docker/queuer/init.sh b/scripts/queuer.sh
similarity index 100%
rename from .docker/queuer/init.sh
rename to scripts/queuer.sh
diff --git a/.docker/scheduler/init.sh b/scripts/scheduler.sh
similarity index 100%
rename from .docker/scheduler/init.sh
rename to scripts/scheduler.sh
From e1009776f609d0b0c7783954cb1e647741ec9e6d Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:53:29 +0800
Subject: [PATCH 08/14] Removed test branch filters
---
.github/workflows/main.yml | 1 -
.github/workflows/pre-deploy.yml | 1 -
2 files changed, 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ae3fdc4..407d84b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,7 +4,6 @@ on:
push:
branches:
- master
- - feature/*
jobs:
Build-Deploy:
diff --git a/.github/workflows/pre-deploy.yml b/.github/workflows/pre-deploy.yml
index dd3d7c0..f4d0af5 100644
--- a/.github/workflows/pre-deploy.yml
+++ b/.github/workflows/pre-deploy.yml
@@ -6,7 +6,6 @@ on:
- "*"
- "*/*"
- "!master"
- - "!feature/*"
jobs:
Test:
From d0edb5f985b0921b85f5f551a0b96023b1069000 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 10:57:23 +0800
Subject: [PATCH 09/14] wip
---
.github/workflows/main.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 407d84b..3f3fb58 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -38,11 +38,11 @@ jobs:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:push -a laravel-react-admin web
+ args: container:push -a laravel-react-admin
- name: Release
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:release -a laravel-react-admin web
\ No newline at end of file
+ args: container:release -a laravel-react-admin
\ No newline at end of file
From 0e2027287855de32799e748c3fc8c80b2b8ad108 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 11:07:58 +0800
Subject: [PATCH 10/14] wip
---
.github/workflows/main.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3f3fb58..058d393 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -38,11 +38,11 @@ jobs:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:push -a laravel-react-admin
+ args: container:push -a laravel-react-admin --recursive
- name: Release
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:release -a laravel-react-admin
\ No newline at end of file
+ args: container:release -a laravel-react-admin --recursive
\ No newline at end of file
From 3a6dd59b64ff8c01d0008d0d049ae390bcee20db Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 11:15:19 +0800
Subject: [PATCH 11/14] wip
---
.github/workflows/main.yml | 5 +++--
.github/workflows/pre-deploy.yml | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 256163c..5806d21 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,6 +4,7 @@ on:
push:
branches:
- master
+ - feature/*
jobs:
Build-Deploy:
@@ -38,11 +39,11 @@ jobs:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:push -a laravel-react-admin --recursive
+ args: container:push -a laravel-react-admin web sqs
- name: Release
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:release -a laravel-react-admin --recursive
+ args: container:release -a laravel-react-admin web sqs
diff --git a/.github/workflows/pre-deploy.yml b/.github/workflows/pre-deploy.yml
index f4d0af5..dd3d7c0 100644
--- a/.github/workflows/pre-deploy.yml
+++ b/.github/workflows/pre-deploy.yml
@@ -6,6 +6,7 @@ on:
- "*"
- "*/*"
- "!master"
+ - "!feature/*"
jobs:
Test:
From 5055d9c6aee12e732f06ff1e9329642ab3fd32d6 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 11:20:08 +0800
Subject: [PATCH 12/14] wip
---
.github/workflows/main.yml | 4 ++--
.github/workflows/pre-deploy.yml | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 5806d21..ce9bf54 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -39,11 +39,11 @@ jobs:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:push -a laravel-react-admin web sqs
+ args: container:push -a laravel-react-admin web
- name: Release
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
- args: container:release -a laravel-react-admin web sqs
+ args: container:release -a laravel-react-admin web
diff --git a/.github/workflows/pre-deploy.yml b/.github/workflows/pre-deploy.yml
index dd3d7c0..f4d0af5 100644
--- a/.github/workflows/pre-deploy.yml
+++ b/.github/workflows/pre-deploy.yml
@@ -6,7 +6,6 @@ on:
- "*"
- "*/*"
- "!master"
- - "!feature/*"
jobs:
Test:
From fa9a754cc171d75cf153d4b97aaa25e45ec04d59 Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 11:42:16 +0800
Subject: [PATCH 13/14] Added readme badges
---
readme.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/readme.md b/readme.md
index fb63794..db1105f 100755
--- a/readme.md
+++ b/readme.md
@@ -8,6 +8,12 @@ in the frontend & [Laravel](https://laravel.com) in the backend.
+
+
+
+
+
+
## Screenshots
From 74a7e0db676837758296375e40faf5af8ad4762e Mon Sep 17 00:00:00 2001
From: Jovert Palonpon
Date: Tue, 1 Oct 2019 11:48:15 +0800
Subject: [PATCH 14/14] Removed test branch filters
---
.github/workflows/main.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ce9bf54..7000ba1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,7 +4,6 @@ on:
push:
branches:
- master
- - feature/*
jobs:
Build-Deploy: