Skip to content

04. Finishing Installation

Daniel Trolezi edited this page Sep 18, 2024 · 2 revisions

The installation script (/install.sh) executes the following:

  • Installs Git-hooks
  • Creates /.env file

Pre-Commit

The pre-commit hook is installed by copying /git-hooks/pre-commit to /.git/hooks/pre-commit.
The hook will run first the phpcs command, and then, if found any PSR-12 errors, it will run phpcbf:

  • If no errors were found, it will stage all files and proceed to run the unit tests.
  • If no-fixable errors were found, it will exit before commit.

Then, if all tests have passed, it will proceed with the commit.

Environment Variables

This script creates the /.env file based on /.env.example, file containing the default env variables.
Credentials for the MySQL and Redis are stored in this file.

APP_NAME="Laravel App"
APP_VERSION=1.0
APP_URL=http://laravel-app.local

APP_ENV=local
APP_KEY=
APP_DEBUG=true

DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=secret

REDIS_HOST=redis
REDIS_PASSWORD=redis