From 20e359d56a80a2a2c1f1ab9ff3c46867ffea1e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 4 Mar 2019 11:37:32 +0400 Subject: [PATCH] :construction_worker: Trigger children images build automatically --- .travis.yml | 2 +- scripts/build-push.sh | 1 + scripts/deploy.sh | 8 ++++++++ scripts/trigger-children.sh | 19 +++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 scripts/deploy.sh create mode 100755 scripts/trigger-children.sh diff --git a/.travis.yml b/.travis.yml index 080c1ad8..24f04c1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,6 @@ script: deploy: provider: script - script: bash scripts/build-push.sh + script: bash scripts/deploy.sh on: branch: master diff --git a/scripts/build-push.sh b/scripts/build-push.sh index 7a00143e..21df633b 100644 --- a/scripts/build-push.sh +++ b/scripts/build-push.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e +set -x echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 00000000..23e37e78 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +set -x + +bash scripts/build-push.sh + +bash scripts/trigger-children.sh diff --git a/scripts/trigger-children.sh b/scripts/trigger-children.sh new file mode 100755 index 00000000..45113e33 --- /dev/null +++ b/scripts/trigger-children.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e +set -x + +body='{ +"request": { +"branch":"master" +}}' + +for child in tiangolo%2Fuvicorn-gunicorn-fastapi-docker tiangolo%2Fuvicorn-gunicorn-starlette-docker; do + curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token $TRAVIS_TOKEN" \ + -d "$body" \ + https://api.travis-ci.org/repo/$child/requests +done