Development Basics
Continuous Integration
A bunch of frontend and backend tools run via GitHub Actions once a commit has been pushed.
Continuous Inspection
Scrutenizer and Coveralls are our weapons of choice to keep track on the quality of our codebase.
Edit on GitHubWindows Environment
Open the PowerShell as Administrator and enter the following commands.
Config PowerShell
Set unrestricted execution policy:
Set-ExecutionPolicy Unrestricted
Install Wizard
Install everything at once and run local development server:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/wizard.ps1'))
Install Git
Install Git on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/git-setup.ps1'))
Config Git
Config your name and email:
git config --global user.name {Your Name}
git config --global user.email {your.name@domain.com}
Install Node
Install Node on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/node-setup.ps1'))
Install Grunt
Install Grunt on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/grunt-setup.ps1'))
Install PHP
Install PHP on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/runtime-setup.ps1'))
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/php-setup.ps1'))
Install Composer
Install Composer on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/composer-setup.ps1'))
Install MySQL
Install the MySQL
bundle on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/mysql-setup.ps1'))
Install PostgreSQL
Install the PostgreSQL
bundle on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/postgresql-setup.ps1'))
Install Papercut
Install Papercut on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/papercut-setup.ps1'))
Install Redaxscript
Install Redaxscript on your local environment:
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://powershell.redaxscript.com/redaxscript-setup.ps1'))Edit on GitHub
Linux Environment
Open the terminal as Root and enter the following commands.
Install Git
Install Git on your local environment:
apt-get install git
Config Git
Config your name and email:
git config --global user.name {Your Name}
git config --global user.email {your.name@domain.com}
Install Node
Install Node on your local environment:
apt-get install nodejs
Install Grunt
Install Grunt on your local environment:
npm install --global grunt-cli
Install PHP
Install PHP on your local environment:
apt-get install php php-cli php-dev
Install Composer
Install Composer on your local environment:
apt-get install composer
Install SQLite
Install the SQLite
bundle on your local environment:
apt-get install sqlite php-sqlite
Install MSSQL
Install the MSSQL
bundle on your local environment:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - curl https://packages.microsoft.com/config/ubuntu/18.10/prod.list > /etc/apt/sources.list.d/mssql-release.list apt-get update
apt-get install msodbcsql mssql-server unixodbc-dev
pecl install pdo_sqlsrv
Config MSSQL
Enable the extension:
echo "extension=pdo_sqlsrv.so" | tee /etc/php/7.2/mods-available/pdo_sqlsrv.ini phpenmod pdo_sqlsrv
Create a test database:
sqlcmd -U sa -P {your-password} -Q 'create database test'
Set the root password:
sqlcmd -U sa -P {your-password} -Q 'alter login sa with password = '\'test\'
Install MySQL
Install the MySQL
bundle on your local environment:
apt-get install mysql-server mysql-client php-mysql
Config MySQL
Create a test database:
mysql -u root -e 'create database test'
Set the root password:
mysqladmin -u root password test
Install PostgreSQL
Install the PostgreSQL
bundle on your local environment:
apt-get install postgresql php-pgsql
Config PostgreSQL
Create a test database:
psql -U postgres -c 'create database test'
Set the root password:
psql -U postgres -c 'alter user postgres with password '\'test\'
Install Xdebug
Install Xdebug on your local environment:
apt-get install php-xdebug
Install Sendmail
Install Sendmail on your local environment:
apt-get install sendmail
Tweak /etc/hosts
if messages stuck in the Sendmail queue:
127.0.0.1 {your-hostname}.localdomain {your-hostname} localhostEdit on GitHub
Frontend Tools
Install
Install the tools described in this section:
composer install
npm install
Serve
Run local development server:
grunt serve [options] -L, --live-reload -O, --open-browser -N, --no-cache -D, --debug-mode
Browse your working copy:
http://localhost:8000
Lint
Validate your CSS
code for consistence:
grunt stylelint
grunt colorguard
Validate your JavaScript
code for consistence:
grunt eslint
Validate your HTML
code for consistence:
grunt ncsslint
grunt htmlhint
Build
Build styles and scripts at once:
grunt build
Build the styles:
grunt build-styles
Build the scripts:
grunt build-scripts
Optimize
Create table of contents for your assets and optimize images:
grunt optimizeEdit on GitHub
Backend Tools
Install
Install the tools described in this section:
composer install
npm install
Lint
Validate your PHP
code for consistence:
grunt phpcs
Unit Testing
Run the unit testing suite:
grunt test-unit
Run the unit testing suite in parallel:
grunt test-unit-parallel
Run the unit testing suite against your MSSQL
database:
DB_URL=mssql://sa:test@127.0.0.1/test grunt test-unit
Run the unit testing suite against your MySQL
database:
DB_URL=mysql://root:test@127.0.0.1/test grunt test-unit
Run the unit testing suite against your PostgreSQL
database:
DB_URL=postgres://postgres:test@127.0.0.1/test grunt test-unit
Acceptance Testing
Run local development server:
grunt serve
Run the acceptance testing suite:
grunt test-acceptance
Run the acceptance testing suite in parallel:
grunt test-acceptance-parallelEdit on GitHub
Docker Container
Installation
Clone from GitHub:
git clone https://github.com/redaxscript/redaxscript-docker.git
Run the container:
docker-compose up
Usage
Browse your working copy:
http://localhost:8000Edit on GitHub