From 5eae8a89785798519aec66fb708389f6e5ea0327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 4 Dec 2018 00:18:49 +0100 Subject: [PATCH 1/2] 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? --- .travis.yml | 16 ++++++++++++++++ scripts/deploy.sh | 4 ++++ 2 files changed, 20 insertions(+) create mode 100755 scripts/deploy.sh diff --git a/.travis.yml b/.travis.yml index 322137700..adfd185f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 000000000..b66b63a77 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "See me deployed at $1 :)" + From 8e462e9cc66e694f981f29b56a2973fe9f0894c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 4 Dec 2018 00:50:00 +0100 Subject: [PATCH 2/2] Typo: `tagS` to deploy only if git tag exists --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index adfd185f5..3afc08703 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ deploy: script: scripts/deploy.sh nitro.human-connection.org on: branch: master - tag: true + tags: true - provider: script script: scripts/deploy.sh nitro-staging.human-connection.org on: @@ -47,5 +47,5 @@ deploy: - provider: script script: scripts/deploy.sh "nitro-$(git rev-parse --short HEAD).human-connection.org" on: - tag: true + tags: true all_branches: true