diff --git a/circle.yml b/circle.yml index 682f3db..a028683 100644 --- a/circle.yml +++ b/circle.yml @@ -3,22 +3,30 @@ machine: - docker dependencies: override: - - docker build -f distribution/release/Dockerfile -t gaiaadm/result-processing:$BUILD_TAG . + - docker build -f distribution/release/nodejs/Dockerfile -t gaiaadm/result-processing:$BUILD_TAG . + - docker build -f distribution/release/python/Dockerfile -t gaiaadm/result-processing:$BUILD_TAG-python . test: override: - docker run -d -e RABBITMQ_PASS="mypass" --name rabbitmq gaiaadm/rabbitmq; sleep 10 - # run system tests + # run system tests on pure Node.js image - docker run -e AMQ_USER="admin" -e AMQ_PASSWORD="mypass" --link rabbitmq:amqserver --name system-test-runner gaiaadm/result-processing:$BUILD_TAG grunt system - - docker cp system-test-runner:/src/unit-test-results.xml $CIRCLE_TEST_REPORTS - - docker cp system-test-runner:/src/unit-test-results.txt $CIRCLE_ARTIFACTS - - docker cp system-test-runner:/src/system-test-results.xml $CIRCLE_TEST_REPORTS - - docker cp system-test-runner:/src/system-test-results.txt $CIRCLE_ARTIFACTS + - docker cp system-test-runner:/src/unit-test-results.xml $CIRCLE_TEST_REPORTS/nodejs + - docker cp system-test-runner:/src/unit-test-results.txt $CIRCLE_ARTIFACTS/nodejs + - docker cp system-test-runner:/src/system-test-results.xml $CIRCLE_TEST_REPORTS/nodejs + - docker cp system-test-runner:/src/system-test-results.txt $CIRCLE_ARTIFACTS/nodejs + # run system tests on Python image + - docker run -e AMQ_USER="admin" -e AMQ_PASSWORD="mypass" --link rabbitmq:amqserver --name system-test-runner-python gaiaadm/result-processing:$BUILD_TAG-python grunt system + - docker cp system-test-runner-python:/src/unit-test-results.xml $CIRCLE_TEST_REPORTS/python + - docker cp system-test-runner-python:/src/unit-test-results.txt $CIRCLE_ARTIFACTS/python + - docker cp system-test-runner-python:/src/system-test-results.xml $CIRCLE_TEST_REPORTS/python + - docker cp system-test-runner-python:/src/system-test-results.txt $CIRCLE_ARTIFACTS/python deployment: hub: branch: master commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - - docker push gaiaadm/result-processing + - docker push gaiaadm/result-processing:$BUILD_TAG + - docker push gaiaadm/result-processing:$BUILD_TAG-python general: branches: only: diff --git a/distribution/release/Dockerfile b/distribution/release/nodejs/Dockerfile similarity index 100% rename from distribution/release/Dockerfile rename to distribution/release/nodejs/Dockerfile diff --git a/distribution/release/python/Dockerfile b/distribution/release/python/Dockerfile new file mode 100644 index 0000000..fe605f2 --- /dev/null +++ b/distribution/release/python/Dockerfile @@ -0,0 +1,18 @@ +FROM gaiaadm/nodejs-python:3.4.0 + +# Bundle app source +COPY . /src + +# setup.sh script is temporary workaround until Docker adds support for passing ENV variables +# to docker build command to allow setting up proxy +ADD setup.sh /tmp/setup.sh +RUN chmod +x /tmp/setup.sh +RUN /tmp/setup.sh + +# Set the working directory +WORKDIR /src + +RUN grunt jshint +RUN grunt unit + +CMD ["node", "/src/server.js"]