Merge "Revert "Patch 1431"" into dev/icn-v0.2.0
[icn.git] / deploy / kud-plugin-addons / device-plugins / qat / yaml / collect_qat_yaml.sh
diff --git a/deploy/kud-plugin-addons/device-plugins/qat/yaml/collect_qat_yaml.sh b/deploy/kud-plugin-addons/device-plugins/qat/yaml/collect_qat_yaml.sh
new file mode 100644 (file)
index 0000000..6f4983b
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# usage: collect_qat_yaml.sh [target]
+
+set -ex
+
+if [ $# -ne 1 ] ; then
+    echo "Please input the target folder!"
+    exit 0
+fi
+
+VER="0.1"
+MKDIR_P="mkdir -p"
+target=$1
+temp=qat_yaml
+
+# copy to target
+$MKDIR_P $temp
+cp qat_plugin_default_configmap.yaml $temp/
+cp qat_plugin_privileges.yaml $temp/
+echo "#!/bin/bash" >> $temp/install.sh
+echo "cat qat_plugin_default_configmap.yaml | kubectl apply -f -" >> $temp/install.sh
+echo "cat qat_plugin_privileges.yaml | kubectl apply -f -" >> $temp/install.sh
+
+if [ ! -d $target/yaml ]; then
+    $MKDIR_P $target/yaml;
+fi;
+
+tar czvf $target/yaml/qat_yaml-$VER.tar.gz $temp/
+
+# clear
+rm -rf $temp