mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
67 lines
2.2 KiB
YAML
67 lines
2.2 KiB
YAML
language: node_js
|
|
node_js:
|
|
- "10"
|
|
cache:
|
|
yarn: true
|
|
directories:
|
|
- node_modules
|
|
services:
|
|
- docker
|
|
|
|
env:
|
|
- DOCKER_COMPOSE_VERSION=1.23.2 BACKEND_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH:-master}}
|
|
|
|
|
|
before_install:
|
|
- echo $BACKEND_BRANCH
|
|
- sudo rm /usr/local/bin/docker-compose
|
|
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
|
|
- chmod +x docker-compose
|
|
- sudo mv docker-compose /usr/local/bin
|
|
|
|
install:
|
|
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT --target production -t humanconnection/nitro-web .
|
|
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml up -d
|
|
- git clone https://github.com/Human-Connection/Nitro-Backend.git ../Nitro-Backend
|
|
- git -C "../Nitro-Backend" checkout $BACKEND_BRANCH || git -C "../Nitro-Backend" checkout master
|
|
- docker-compose -f ../Nitro-Backend/docker-compose.yml -f ../Nitro-Backend/docker-compose.travis.yml up -d
|
|
- yarn global add cypress wait-on
|
|
- yarn add cypress-cucumber-preprocessor
|
|
|
|
script:
|
|
- docker-compose exec -e NODE_ENV=test webapp yarn run lint
|
|
- docker-compose exec -e NODE_ENV=test webapp yarn run test
|
|
- docker-compose -f ../Nitro-Backend/docker-compose.yml exec backend yarn run db:seed > /dev/null
|
|
- wait-on http://localhost:3000
|
|
- cypress run --record --key $CYPRESS_TOKEN
|
|
|
|
after_success:
|
|
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
|
- chmod +x send.sh
|
|
- ./send.sh success $WEBHOOK_URL
|
|
|
|
after_failure:
|
|
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
|
- chmod +x send.sh
|
|
- ./send.sh failure $WEBHOOK_URL
|
|
|
|
deploy:
|
|
- provider: script
|
|
script: scripts/docker_push.sh
|
|
on:
|
|
branch: master
|
|
- provider: script
|
|
script: scripts/deploy.sh nitro.human-connection.org
|
|
on:
|
|
branch: master
|
|
tags: true
|
|
- provider: script
|
|
script: scripts/deploy.sh nitro-staging.human-connection.org
|
|
on:
|
|
branch: master
|
|
- provider: script
|
|
script: scripts/deploy.sh "nitro-$(git rev-parse --short HEAD).human-connection.org"
|
|
on:
|
|
tags: true
|
|
all_branches: true
|