mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
But avoid synced volumes, otherwise the deployment will crash because Travis cannot clean up files just before entering the deployment.
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
language: node_js
|
|
node_js:
|
|
- "10"
|
|
cache:
|
|
yarn: true
|
|
directories:
|
|
- node_modules
|
|
services:
|
|
- docker
|
|
|
|
env:
|
|
- DOCKER_COMPOSE_VERSION=1.23.2
|
|
|
|
before_install:
|
|
- 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-backend:latest .
|
|
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml up -d
|
|
|
|
script:
|
|
- docker-compose exec backend yarn run lint
|
|
- docker-compose exec backend yarn run test
|
|
- docker-compose exec backend yarn run test:coverage
|
|
- docker-compose exec backend yarn run db:reset
|
|
- docker-compose exec backend yarn run db:seed
|
|
|
|
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-$TRAVIS_COMMIT.human-connection.org"
|
|
on:
|
|
tags: true
|
|
all_branches: true
|