]> gitweb.fluxo.info Git - hydra.git/commitdiff
Deploy: support for class names
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 27 May 2018 13:53:26 +0000 (10:53 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 27 May 2018 13:53:26 +0000 (10:53 -0300)
share/hydra/deploy

index 9a43edff390ee1a25cb149e691fdca6eba560ffd..015f81a8dcba53da83d4960f9a366cdafd158824 100755 (executable)
@@ -31,6 +31,16 @@ NODES="$*"
 # Build node list
 if [ -z "$NODES" ]; then
   NODES="`hydra $HYDRA nodes`"
+else
+  # Check if first param is a node name, otherwise assume its a class
+  if [ -z "$2" ]; then
+    NODEFILE="$(basename `find $HYDRA_FOLDER/puppet/config/node/ -name $1'.*' | head -n 1` .yaml)"
+
+    # Check for config/node name
+    if [ "$NODEFILE" == ".yaml" ]; then
+      NODES="`hydra $HYDRA nodes $1`"
+    fi
+  fi
 fi
 
 # Deploy requirements