summaryrefslogtreecommitdiffstats
path: root/bash/tools/creating_data/make-git-http-list.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bash/tools/creating_data/make-git-http-list.sh')
-rw-r--r--bash/tools/creating_data/make-git-http-list.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/bash/tools/creating_data/make-git-http-list.sh b/bash/tools/creating_data/make-git-http-list.sh
index 1e97d337..a724d6f0 100644
--- a/bash/tools/creating_data/make-git-http-list.sh
+++ b/bash/tools/creating_data/make-git-http-list.sh
@@ -1,3 +1,5 @@
+# COPYRIGHT NOTICE STARTS HERE
+#
# Copyright 2018 © Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,27 +15,38 @@
# limitations under the License.
#
# COPYRIGHT NOTICE ENDS HERE
+
if [[ -z "$LISTS_DIR" ]]; then
LISTS_DIR=.
echo "Using default output directory ."
fi
+
OOM_PATH="$1"
+
if [[ -z "$OOM_PATH" ]]; then
echo "Missing oom path"
exit 1
fi
+
+
GOUTPUT="$LISTS_DIR/git_repos_list"
FOUTPUT="$LISTS_DIR/fetch_list.txt"
+
trim_last() {
echo "${@:1:$#-1}";
}
+
TMP='/tmp/git_tmp_list'
:> $TMP
+
:> $FOUTPUT
+
echo "Gathering git repos and list possible html data"
+
while read -r chart; do
out="$(helm template $(dirname "$chart") 2>/dev/null)"
gitcmds=$(echo "$out" | grep 'git clone')
+
if [[ -n "$gitcmds" ]] ; then
while read gitcmd; do
gitcmd=$(trim_last $gitcmd)
@@ -43,6 +56,7 @@ while read -r chart; do
echo "$full" >> $TMP
done <<< "$gitcmds"
fi
+
fetchcmds=$(echo "$out" | grep 'wget \|curl ' | grep -v 'HEALTH_CHECK_ENDPOINT\|PUT\|POST' )
if [[ -n "$fetchcmds" ]] ; then
while read fetchcmd; do
@@ -51,5 +65,10 @@ while read -r chart; do
echo "$fetchcmd" >> $FOUTPUT
done <<< "$fetchcmds"
fi
+
+
done <<< "$(find $OOM_PATH -name Chart.yaml)"
+
sort $TMP | uniq > $GOUTPUT
+
+