-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1859aab
commit 6812e92
Showing
2 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
version: 0.2 | ||
phases: | ||
install: | ||
commands: | ||
#This file configures apt to remove it's cache after installs - we want this cache, so we remove this config | ||
- rm -f /etc/apt/apt.conf.d/docker-clean | ||
|
||
#Install required packages | ||
- | | ||
export DEBIAN_FRONTEND=noninteractive | ||
#Install php7.1 | ||
apt-get update | ||
apt-get install -y software-properties-common | ||
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php | ||
apt-get update | ||
# Install PHP 7.1. The ondrej/php repository also contains other versions of php, try just changing the version number | ||
apt-get install -y php7.1\ | ||
php7.1-ldap \ | ||
php7.1-xml \ | ||
php7.1-xmlrpc \ | ||
php7.1-zip \ | ||
php7.1-mysql \ | ||
php7.1-mbstring \ | ||
php7.1-mcrypt \ | ||
php7.1-gd \ | ||
php7.1-readline \ | ||
php7.1-opcache \ | ||
php7.1-xdebug \ | ||
php7.1-dom \ | ||
php-xdebug \ | ||
php7.1-curl \ | ||
unzip | ||
#Enable xdebug - phpunit uses this for code coverage | ||
phpenmod xdebug | ||
# Install MySQL (do you need it? If not, delete this) | ||
apt-get install -y mysql-server | ||
#Install composer | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
php composer-setup.php ; | ||
php -r "unlink('composer-setup.php');" ; | ||
mv composer.phar /usr/local/bin/composer | ||
#Various handy node based dev tools - do you need these during your build? Comment if not. | ||
#npm install -g gulp | ||
#npm install -g grunt | ||
#npm install -g webpack | ||
# Start Mysql if you need it | ||
- su mysql -s /bin/bash -c "/usr/sbin/mysqld" & | ||
|
||
build: | ||
commands: | ||
- echo Build started on `date` | ||
- echo Installing composer deps | ||
- composer install --no-progress --no-suggest | ||
|
||
post_build: | ||
commands: | ||
- echo Build completed on `date` | ||
|
||
# Create a mysql database | ||
# Do you need to do this? In many cases phpunit will use sqllite or similar to avoid the need for a real DB. | ||
# If you don't need it delete it | ||
- /usr/bin/mysql -u root -e "GRANT ALL ON *.* TO 'test'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION" | ||
- mysqladmin -u test create test | ||
|
||
# Run your tests | ||
- ./vendor/bin/phpunit --coverage-html coverage | ||
|
||
- aws s3 sync --delete coverage/ "s3://${COVERAGE_S3_BUCKET}/coverage" | ||
|
||
# Deployment to the SFTP server | ||
- echo $SSH_KEY > ~/.ssh/id_rsa | ||
- echo $SSH_KEY | ||
- scp -p ${SFTP_PORT} -r build/ ${SSH_USERNAME}@${SSH_SERVER}:/public_html | ||
- ssh ${SSH_USERNAME}@${SSH_SERVER} -p ${SFTP_PORT} rm -f .cache | ||
|
||
|
||
|
||
cache: | ||
paths: | ||
#Debian package caches, so we don't need to keep redownloading debian packages: | ||
- /var/cache/apt/**/* | ||
|
||
# Composer cache: | ||
- /root/.composer/**/* | ||
|
||
# Node modules, if you need nodejs based tools like webpack during your build | ||
- /root/.npm/**/* | ||
- /usr/lib/node_modules/**/* |
This file contains 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