Skip to content

Commit

Permalink
👷 Trigger children images build automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 4, 2019
1 parent 37dbc18 commit 20e359d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ script:

deploy:
provider: script
script: bash scripts/build-push.sh
script: bash scripts/deploy.sh
on:
branch: master
1 change: 1 addition & 0 deletions scripts/build-push.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

set -e
set -x

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

Expand Down
8 changes: 8 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e
set -x

bash scripts/build-push.sh

bash scripts/trigger-children.sh
19 changes: 19 additions & 0 deletions scripts/trigger-children.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 20e359d

Please sign in to comment.