try updating travis yaml again

This commit is contained in:
Cassie Tarakajian 2018-08-24 19:05:33 -04:00
parent 472bc0b425
commit 1493d3e5ae

View file

@ -6,26 +6,28 @@ node_js:
services: services:
- docker - docker
before_install: stages:
- test
- build
jobs:
include:
- stage: test
before_install:
- docker-compose -f docker-compose-development.yml up -d - docker-compose -f docker-compose-development.yml up -d
- docker ps -a - docker ps -a
install: true
install: true script:
# Run unit tests in the app container
script: - docker-compose exec -T app npm run test --verbose
# Run unit tests in the app container - stage: build
- docker-compose exec -T app npm run test --verbose if: branch = master OR branch = production-docker
env:
after_success:
# build images
if: branch = master OR branch = production-docker
- docker-compose stop
- docker-compose build --no-cache
- docker image ls
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker tag $APP_IMAGE_NAME $DOCKER_USERNAME/$DOCKER_REPOSITORY:latest
- docker push $DOCKER_USERNAME/$DOCKER_REPOSITORY:latest
env:
global:
- APP_IMAGE_NAME=p5jswebeditor_app - APP_IMAGE_NAME=p5jswebeditor_app
script:
- docker-compose stop
- docker-compose build --no-cache
- docker image ls
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker tag $APP_IMAGE_NAME $DOCKER_USERNAME/$DOCKER_REPOSITORY:latest
- docker push $DOCKER_USERNAME/$DOCKER_REPOSITORY:latest