-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-ubuntu.sh
executable file
·40 lines (34 loc) · 1.44 KB
/
build-ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
set -eu
# only branch latest and no pull requuest builds are deployed
if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then
IMG="quay.io/experimentalplatform/ubuntu:$TRAVIS_BRANCH"
echo " * Flattening $IMG"
ID=$(docker run -d "$IMG" /bin/bash)
docker export $ID | docker import - "$IMG"
docker login -e 'none' -u $QUAY_USER -p $QUAY_PASS quay.io
docker push "$IMG"
if [[ ${TRIGGER:-false} == "true" ]]; then
for project in platform-app-manager platform-central-gateway platform-configure platform-dnsmasq platform-dokku platform-frontend platform-hardware platform-hostapd platform-hostname-avahi platform-hostname-smb platform-monitoring platform-ptw platform-pulseaudio platform-skvs platform-smb platform-systemd-proxy; do
URL="https://api.travis-ci.org/repo/experimental-platform%2F${project}/requests"
BODY="{ \"request\": {
\"message\": \"Triggered by '$TRAVIS_REPO_SLUG'\",
\"config\": {
\"env\": {
\"TRIGGER\": \"true\"
}}}}"
STATUSCODE=$(curl -s -i -X POST --output /dev/stderr --write-out "%{http_code}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_TOKEN" \
-d "$BODY" \
$URL)
if test $STATUSCODE -ne 202; then
exit 1
fi
echo "Triggered experimental-platform/${project}"
sleep 5
done
fi
fi