forked from RackHD/on-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_children.sh
More file actions
21 lines (15 loc) · 776 Bytes
/
build_children.sh
File metadata and controls
21 lines (15 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#Gets the latest Master build
GetMasterBuild () {
BUILD=$(curl -s 'https://api.travis-ci.org/repos/RackHD/'$1'/branches/master' | grep -o '{"branch":{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n')
echo $BUILD
}
# Get last child project build number
BUILD_NUM_TASKGRAPH=$(GetMasterBuild on-taskgraph)
BUILD_NUM_HTTP=$(GetMasterBuild on-http)
# Restart last child project build
curl -X POST https://api.travis-ci.org/builds/$BUILD_NUM_TASKGRAPH/restart --header "Authorization: token "$AUTH_TOKEN
curl -X POST https://api.travis-ci.org/builds/$BUILD_NUM_HTTP/restart --header "Authorization: token "$AUTH_TOKEN
#Echo out what builds where restarted
echo Restarted on-taskgraph Build = $BUILD_NUM_TASKGRAPH
echo Restarted on-http Build = $BUILD_NUM_HTTP