Skip to content

Commit

Permalink
refactor circle ci build
Browse files Browse the repository at this point in the history
make circle ci see the webserver
  • Loading branch information
arroyo committed Jul 11, 2017
1 parent f218109 commit 7230d8b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
11 changes: 6 additions & 5 deletions .circleci/config.yml
Expand Up @@ -27,13 +27,14 @@ jobs:
pwd
ls -al
docker-compose -f docker-compose-ci.yml up -d
cd /code
docker cp ./ erdiko_users_php:/code
docker cp ./ erdiko_users_web:/code
pwd
ls -al
./scripts/ci/build-ci.sh
docker exec -it erdiko_users_php /code/scripts/ci/install.sh
# docker exec -it erdiko_users_web /code/scripts/ci/install-web.sh
docker exec -it erdiko_users_php /code/scripts/ci/curl-test.sh
- run:
name: Run PHPUnit tests
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -42,6 +42,11 @@ pass: password

After you login, click around and try to figure out how to update your password.

### Running unit tests

To run phpunit tests for all repos there is a convenience script. Get in the habit of running this before pushing your commits or making a pull request.

docker exec -it erdiko_users_php /code/scripts/ci/run-php-tests.sh

### Angular

Expand Down
4 changes: 2 additions & 2 deletions TESTING.md
@@ -1,7 +1,7 @@
Testing
=======

##phpunit
## phpunit

Run all unit tests with the following commands. Be sure you are running the full stack (docker-compose up) or the tests will fail since there is no database to connect to.

Expand All @@ -11,7 +11,7 @@ Run all unit tests with the following commands. Be sure you are running the ful
or
docker-compose run php /code/scripts/ci/run-php-tests.sh

##misc ci notes
## Misc ci notes

cd scripts/dev
./install-dev.sh
Expand Down
15 changes: 11 additions & 4 deletions docker-compose-ci.yml
Expand Up @@ -2,20 +2,27 @@ version: '2.1'

services:

data:
image: busybox
volumes:
- ./:/code
- ./composer-dev.json:/code/composer.json
- ./repos/authenticate:/authenticate
- ./repos/authenticate:/authorize
- ./repos/authenticate/users:/users

webserver:
extends:
file: ./docker/nginx/docker-compose.yml
service: webserver
container_name: erdiko_users_web
ports:
- "80:80"
volumes_from: [data]

php:
container_name: erdiko_users_php
env_file: ./docker/environment.env
image: erdiko/php-fpm:latest
extra_hosts:
- "docker.local:172.17.0.1"
volumes_from: [data]

db:
extends:
Expand Down
6 changes: 2 additions & 4 deletions scripts/ci/build-ci.sh
Expand Up @@ -2,7 +2,5 @@

docker-compose -f docker-compose-ci.yml up -d

docker cp ./ erdiko_users_php:/code
docker cp ./ erdiko_users_web:/code

docker exec -it erdiko_users_php /code/scripts/ci/install.sh
docker exec -it erdiko_users_php /code/scripts/dev/update-composer.sh
docker exec -it erdiko_users_php /code/scripts/install-db.sh
3 changes: 3 additions & 0 deletions scripts/ci/curl-test.sh
@@ -0,0 +1,3 @@
#!/bin/sh

curl webserver

0 comments on commit 7230d8b

Please sign in to comment.