@arisan/data-api
Version:
The Universal Database API Gateway for CLIO's Modules
12 lines (8 loc) • 582 B
Plain Text
description "Automatic GitLab Runner Registration"
start on started gitlab-runner
script
gitlab=$(gcloud compute instances list --regexp=^gitlab-[0-9].*$ --format='value(name)')
gitlab-ci-multi-runner register --non-interactive --url=http://${gitlab} --registration-token=%REGISTRATION_TOKEN% --executor=shell
zone=$(curl -H "Metadata-Flavor:Google" http://metadata.google.internal/computeMetadata/v1/instance/zone | cut -d'/' -f4)
gcloud compute instances add-metadata $(hostname) --zone=${zone} --metadata-from-file shutdown-script=/usr/local/bin/unregister
end script