Skip to content

Commit

Permalink
Merge pull request #24 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 0.6.1
  • Loading branch information
mtompset authored Mar 24, 2020
2 parents ad09e5e + 1a5b108 commit 7ec9b55
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM silintl/php7:7.2
MAINTAINER Mark Tompsett <[email protected]>

ENV REFRESHED_AT 2020-03-16

# Fix timezone stuff from hanging.
RUN apt-get update -y && echo "America/New_York" > /etc/timezone; \
apt-get install -y tzdata

# Make sure apt has current list/updates
# Install necessary PHP building blocks
# Install Apache and PHP (and any needed extensions).
# Install mock DB stuff
RUN apt-get install -y zip unzip make curl wget \
php php-pdo php-xml php-mbstring sqlite php-sqlite3

RUN mkdir -p /data
WORKDIR /data
COPY ./ /data

RUN cd /data && ./composer-install.sh
RUN mv /data/composer.phar /usr/bin/composer
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
it-now: clean install phpunit

clean:
sudo rm -rf ./vendor
rm -f composer.lock

install:
docker-compose run --rm cli bash -c "cd /data;composer install"

update:
docker-compose run --rm cli bash -c "cd /data;composer update"

phpunit:
docker-compose run --rm cli bash -c "cd /data/SilMock/tests;./phpunit"

# For use in virtualbox.
test:
cd /var/lib/GA_mock/SilMock/tests; /var/lib/GA_mock/SilMock/tests/phpunit
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ implements include...

1. listUsersSettingsForwardingAddresses()

Unit Testing
------------
If you are able to run docker natively, then:
- make it-now

If not, then use vagrant up:
- vagrant up
- vagrant ssh
- cd /var/lib/GA_mock
- make test

Data Persistence
----------------
In order to keep data available for use by this mock, it makes use of a **Sqlite**
Expand Down
17 changes: 17 additions & 0 deletions composer-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
3 changes: 1 addition & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2.2'
services:
cli:
build: ./
volumes:
- ./:/data
working_dir: /data
command: ["true"]

networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.20.35.0/24
gateway: 10.20.35.1

0 comments on commit 7ec9b55

Please sign in to comment.