Last active
February 23, 2021 13:07
-
-
Save nafiesl/98e1826f8e145d0dcd916457fad10e4b to your computer and use it in GitHub Desktop.
Codeship Setup Commands for Laravel that uses MySQL Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phpenv local 7.0 | |
echo "memory_limit = 512M" >> /home/rof/.phpenv/versions/$(phpenv version-name)/etc/php.ini | |
# install dependencies | |
COMPOSER_HOME=${HOME}/cache/composer | |
composer install --prefer-dist --no-interaction | |
# set up environment variables | |
touch .env | |
echo "APP_ENV=testing" >> .env | |
echo "APP_DEBUG=true" >> .env | |
echo "APP_KEY=base64:sQPFP80eWJQGo0SDPc+M2Tib+GLUocRYRw4RLsfM27I=" >> .env | |
echo "DB_HOST=localhost" >> .env | |
echo "DB_DATABASE=test" >> .env | |
echo "DB_USERNAME=$MYSQL_USER" >> .env | |
echo "DB_PASSWORD=$MYSQL_PASSWORD" >> .env | |
# set up laravel | |
mkdir -p ./storage/framework/views | |
mkdir -p ./storage/framework/sessions | |
mkdir -p ./build/logs | |
chmod -R 777 ./storage | |
php artisan migrate | |
php artisan db:seed | |
php artisan cache:clear | |
php artisan optimize --force | |
mysql -u $MYSQL_USER -e'SET GLOBAL max_connections=1000;' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_DATABASE=test vendor/bin/phpunit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment