Configure Travis CI conditional builds

and add placeholder deployment. This commit should deploy to

* `production` if on branch master AND tagged
* `staging` if on branch master
* `custom` if tagged

The custom deployment is inspired by https://zeit.co/now and should
deploy features for demonstration purposes before merging into master.

It will happen that we trigger multiple deployments with this workflow:
If we deploy to production, that is going to deploy to a custom
environment and to staging. But I think this is not too problematic.

What do you think @appinteractive @mcwimpy?
This commit is contained in:
Robert Schäfer 2018-12-04 00:18:49 +01:00
parent fa8cbba421
commit 5eae8a8978
2 changed files with 20 additions and 0 deletions

View File

@ -33,3 +33,19 @@ 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/deploy.sh nitro.human-connection.org
on:
branch: master
tag: 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:
tag: true
all_branches: true

4
scripts/deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "See me deployed at $1 :)"