Skip to content

Commit

Permalink
Docker tests, image building and pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
lekum committed Oct 27, 2015
1 parent ef0aa6a commit b20445d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
15 changes: 14 additions & 1 deletion circle.yml
@@ -1,13 +1,18 @@
machine:
node:
version: 0.12.3
services:
- docker
environment:
VERSION: 0.1.$CIRCLE_BUILD_NUM
general:
artifacts:
- coverage
test:
pre:
- npm run jshint
- npm run dredd
- docker build -t resonator:testing .
override:
- npm run test
- npm run coverage-1
Expand All @@ -16,17 +21,25 @@ test:
- npm run coverage-4
- npm run coverage-5
- npm run coverage-6
- cd test/dockerized-testing-environment && docker-compose up -d && docker-compose run resonator run dockertest && docker-compose stop
deployment:
npm:
branch: master
commands:
- npm version 0.1.$CIRCLE_BUILD_NUM --no-git-tag-version
- npm version $VERSION --no-git-tag-version
- "printf \"_auth=$NPM_AUTH\\nemail=$NPM_USERNAME\\n\" > npmrc"
- npm publish --userconfig npmrc
- rm npmrc
hub:
branch: dockerize_tests
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker tag resonator:testing $DOCKERHUB_BASE/resonator:$VERSION
- docker push $DOCKERHUB_BASE/resonator:$VERSION
notify:
webhooks:
- url: 'https://igz006.herokuapp.com/api/activity/circleci'
dependencies:
pre:
- npm install -g dredd
- sudo pip install -U docker-compose==1.3.3
File renamed without changes.
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -7,12 +7,13 @@
"start": "node ./bin/server.js",
"start-mock": "node ./bin/mocked-server.js",
"fixtures": "node ./scripts/load_fixtures",
"docker-fixtures": "NODE_ENV=dockertest node ./scripts/load_fixtures",
"test": "npm run test-cucumber && npm run test-mocha",
"docker-test": "npm run docker-test-cucumber && npm run docker-test-mocha",
"dockertest": "npm run dockertest-cucumber && npm run dockertest-mocha",
"test-cucumber": "NODE_ENV=test npm run fixtures && NODE_ENV=test cucumber-js cucumber/features/ --tags ~@ignore -r cucumber/features/support -r cucumber/features/",
"docker-test-cucumber": "NODE_ENV=docker-test npm run fixtures && NODE_ENV=docker-test cucumber-js cucumber/features/ --tags ~@ignore -r cucumber/features/support -r cucumber/features/",
"dockertest-cucumber": "npm run docker-fixtures && NODE_ENV=dockertest cucumber-js cucumber/features/ --tags ~@ignore -r cucumber/features/support -r cucumber/features/",
"test-mocha": "NODE_ENV=test npm run fixtures && NODE_ENV=test ./node_modules/.bin/mocha --reporter nyan",
"docker-test-mocha": "NODE_ENV=docker-test npm run fixtures && NODE_ENV=docker-test ./node_modules/.bin/mocha --reporter nyan",
"dockertest-mocha": "npm run docker-fixtures && NODE_ENV=dockertest ./node_modules/.bin/mocha --reporter nyan",
"api": "node_modules/.bin/file-composer -i doc/api.md -o apiary.apib",
"dredd": "npm run api && dredd --reporter nyan",
"api-git": "git add apiary.apib",
Expand Down
1 change: 0 additions & 1 deletion test/dockerized-testing-environment/docker-compose.yml
Expand Up @@ -2,7 +2,6 @@ resonator:
image: resonator:testing
links:
- mongodb:mongodb
command: run docker-test

mongodb:
image: mongo:2.6
Expand Down

0 comments on commit b20445d

Please sign in to comment.