Add sonar-prescan-script jobs for maven
[releng/global-jjb.git] / shell / capture-instance-metadata.sh
index a5914ad..c102d53 100644 (file)
@@ -17,6 +17,11 @@ if [ -n "${NOMAD_DC}" ]; then
     exit 0
 fi
 
+if [[ ! -f /run/cloud-init/result.json ]]; then
+    echo "INFO: Running in unsupported cloud, no metadata"
+    exit 0
+fi
+
 # AWS not supported, exit
 cloudtype="$(jq -r .v1.datasource /run/cloud-init/result.json)"
 if [[ $cloudtype == "DataSourceEc2Local" ]]; then