Skip to content

Commit

Permalink
Merge pull request #68 from avatarnewyork/php55beta
Browse files Browse the repository at this point in the history
Php55beta
  • Loading branch information
mrpatrick committed Jan 14, 2016
2 parents 7525f5b + f7c865a commit 36c0f4c
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 42 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ sandboxproject:
POSTFIX_PWD: somesecretpassword
XDEBUG_CLIENT_IP: 10.2.0.51
```

### Available Tags / Versions
* For a list of supported PHP versions, go here: https://registry.hub.docker.com/u/avatarnewyork/dockerenv-apache/tags/manage/
* Anything appended with "beta" should be considered unstable and is bleeding edge

## Environment Varaibles
### Email - mailgun
Ask your admin for these (different for staging / dev environments)
Expand Down
34 changes: 17 additions & 17 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
machine:
ruby:
version: rbx-2.2.6
version: rbx-2.2.10
services:
- docker

dependencies:
override:
- sudo pip install --upgrade docker-compose==1.2.0
- bundle install

# ngrock /ghostinspector real request
- unzip -d ~/ ~/$CIRCLE_PROJECT_REPONAME/ngrok_2.0.19_linux_amd64.zip
post:
# remove any cached files - cache seems to cause issues
- rm -rf ~/.gradle
- rm -rf ~/.bundle
- rm -rf ~/.cache/bower
- rm -rf ~/.go_workspace
- rm -rf ~/.ivy2
- rm -rf ~/.m2
- rm -rf ~/dockerenv_apache/vendor/bundle
- rm -rf ~/virtualenvs
test:
override:
- docker-compose -f docker-compose.yml run web /.composer/vendor/phpunit/phpunit/phpunit /var/www/html/:
- bash:
parallel: true
files:
- testrunners/*.sh
timeout: 1200
- rake spec:
timeout: 1200
# start apache in background
- docker-compose -f docker-compose.yml up -d
# ngrock /ghostinspector real request
- unzip -d ~/ ~/$CIRCLE_PROJECT_REPONAME/ngrok_2.0.19_linux_amd64.zip
- ~/ngrok authtoken $NGROK_TOKEN
- ~/ngrok http -subdomain=$CIRCLE_SHA1 8888:
background: true
# Wait for application and ngrok to be ready
- curl --retry 10 --retry-delay 10 -v https://$CIRCLE_SHA1.ngrok.io
# Execute Ghost Inspector tests using the ngrok tunnel
- curl "https://api.ghostinspector.com/v1/suites/$GHOST_SUITE_ID/execute/?apiKey=$GHOST_API_KEY&startUrl=https://$CIRCLE_SHA1.ngrok.io" > $CIRCLE_ARTIFACTS/ghostinspector.json
- if [ $(grep -c '"passing":false' $CIRCLE_ARTIFACTS/ghostinspector.json) -ne 0 ]; then exit 1; fi

post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

curl -H "Content-Type: application/json" --data '{"build": true}' -X POST $DOCKERHUB_TRIGGER_URL
curl -H "Content-Type: application/json" --data '{"source_type": "Branch", "source_name": "'$CIRCLE_BRANCH'"}' -X POST $DOCKERHUB_TRIGGER_URL
17 changes: 9 additions & 8 deletions root/packages.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#/bin/bash

yum -y install \
git \
mlocate \
openssh-server \
openssh-clients \
passwd \
pwgen \
httpd \
gcc
git \
mlocate \
openssh-server \
openssh-clients \
passwd \
pwgen \
httpd \
unzip \
gcc

# drush requirements
yum -y install \
Expand Down
70 changes: 70 additions & 0 deletions root/packages_php56.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#/bin/bash

# ImageMagick
yum -y install \
gcc \
ImageMagick \
ImageMagick-devel


yum -y install \
php56w \
php56w-common \
php56w-cli \
php56w-ldap \
php56w-mbstring \
php56w-pdo \
php56w-soap \
php56w-bcmath \
php56w-intl \
php56w-pear \
php56w-mcrypt \
php56w-opcache \
php56w-mysql \
php56w-devel \
php56w-gd \
php56w-pecl-memcache \
php56w-pecl-memcached \
php56w-pecl-imagick \
php56w-pspell \
php56w-snmp \
php56w-xmlrpc \
php56w-xml \
php56w-process \
php56w-pecl-xdebug \
php56w-devel


# Solr
yum -y install \
curl-devel \
libxml2-devel

yes '' | pecl install -f solr-2.3.0

echo "extension=solr.so" > /etc/php.d/solr.ini


# ssh / sftp
yum -y install libssh2-devel
printf "\n" | pecl install -f ssh2-0.12
echo "extension=ssh2.so" > /etc/php.d/ssh2.ini

# Drush
wget -O /usr/bin/drush http://files.drush.org/drush.phar; chmod 755 /usr/bin/drush

# OAuth
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin; pecl install oauth-1.2.3
echo 'extension=oauth.so' > /etc/php.d/oauth.ini

# Composer
cd /usr/bin; /usr/bin/php -dzend_extension=xdebug.so -r "readfile('https://getcomposer.org/installer');" | php

# PHPUnit
COMPOSER_HOME=/.composer /usr/bin/php -dzend_extension=xdebug.so composer.phar global require --prefer-source "phpunit/phpunit=4.5.*"

# Selenium
COMPOSER_HOME=/.composer /usr/bin/php -dzend_extension=xdebug.so composer.phar global require --prefer-source "phpunit/phpunit-selenium": ">=1.2"

# wp-cli - wordpress cli
COMPOSER_HOME=/.composer /usr/bin/php -dzend_extension=xdebug.so composer.phar global require --prefer-source "wp-cli/wp-cli=0.21.1"
24 changes: 8 additions & 16 deletions spec/localhost/Dockerfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@ def remove(options={}); end
set :docker_image, image.id
end

it "installs the right version of Centos" do
expect(os_version).to include("CentOS release 6.7")
end

it "installs required packages" do
expect(package("httpd")).to be_installed
expect(package("npm")).to be_installed
expect(package("php55w")).to be_installed
expect(package("php55w-pecl-memcached")).to be_installed
expect(package("php55w-pecl-memcache")).to be_installed
expect(package("php55w-pecl-imagick")).to be_installed
end

describe 'Apache Install' do
Expand Down Expand Up @@ -82,16 +74,16 @@ def remove(options={}); end
end
end

describe 'Misc installed packages' do
describe command('which drush') do
its(:stdout) { should match "/usr/bin/drush" }
describe 'Misc installed executables' do
describe file("/usr/bin/drush") do
it { should be_executable }
end
describe command('which composer.phar') do
its(:stdout) { should match "/usr/bin/composer.phar" }
describe file("/usr/bin/composer.phar") do
it { should be_executable }
end
describe file("/usr/bin/unzip") do
it { should be_executable }
end
end

def os_version
command("/bin/cat /etc/redhat-release").stdout
end
end
16 changes: 16 additions & 0 deletions testrunners/test_ghostinspector.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# start apache in background
docker-compose -f docker-compose.yml up -d

~/ngrok authtoken $NGROK_TOKEN

~/ngrok http -log=stdout -subdomain=$CIRCLE_SHA1 8888 > /dev/null &

# Wait for application and ngrok to be ready
curl --retry 10 --retry-delay 10 -v https://$CIRCLE_SHA1.ngrok.io

# Execute Ghost Inspector tests using the ngrok tunnel
curl "https://api.ghostinspector.com/v1/suites/$GHOST_SUITE_ID/execute/?apiKey=$GHOST_API_KEY&startUrl=https://$CIRCLE_SHA1.ngrok.io" > $CIRCLE_ARTIFACTS/ghostinspector.json

if [ $(grep -c '"passing":false' $CIRCLE_ARTIFACTS/ghostinspector.json) -ne 0 ]; then exit 1; fi
3 changes: 3 additions & 0 deletions testrunners/test_phpunit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose -f docker-compose.yml run web /.composer/vendor/phpunit/phpunit/phpunit /var/www/html/
3 changes: 3 additions & 0 deletions testrunners/test_rspec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

rake spec
1 change: 1 addition & 0 deletions tests/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function testStandardExtensionsLoaded()
$this->assertEquals(true, extension_loaded('imagick'));
$this->assertEquals(true, extension_loaded('ssh2'));
$this->assertEquals(true, extension_loaded('memcache'));
$this->assertEquals(true, extension_loaded('memcached'));
$this->assertEquals(true, extension_loaded('solr'));
$this->assertEquals(true, extension_loaded('xdebug'));
$this->assertEquals(true, extension_loaded('curl'));
Expand Down

0 comments on commit 36c0f4c

Please sign in to comment.