Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions systemd-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {
if [[ "${TRAVIS_WORKER_PROVIDER_NAME}" == gce ]]; then
local gce_zone
gce_zone="$(__fetch_gce_zone)"
if [ -z "${gce_zone}" ]; then
if [[ ! "${gce_zone}" ]]; then
gce_zone=us-central1-b
fi
echo "TRAVIS_WORKER_GCE_ZONE=${gce_zone}" >>"${env_file}"
Expand All @@ -29,7 +29,7 @@ main() {
echo "TRAVIS_WORKER_LIBRATO_SOURCE=${librato_source}" >>"${env_file}"
fi

if [ -f "${TRAVIS_WORKER_PRESTART_HOOK}" ]; then
if [[ -f "${TRAVIS_WORKER_PRESTART_HOOK}" ]]; then
"${TRAVIS_WORKER_PRESTART_HOOK}"
fi

Expand All @@ -46,16 +46,16 @@ main() {

__fetch_gce_zone() {
curl -sSL \
"http://metadata.google.internal/computeMetadata/v1/instance/zone" \
-H "Metadata-Flavor: Google" |
'http://metadata.google.internal/computeMetadata/v1/instance/zone' \
-H 'Metadata-Flavor: Google' |
awk -F/ '{ print $NF }'
}

__build_librato_source() {
local host_name="${1}"
local name="${2}"

if [[ "${name}" == "travis-worker" ]]; then
if [[ "${name}" == travis-worker ]]; then
echo "${host_name}"
return
fi
Expand Down
1 change: 1 addition & 0 deletions systemd.service
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Service definition to be installed somewhere in the systemd load path
# vim:filetype=systemd
[Unit]
Description=Travis Worker

Expand Down