Compare commits
3 Commits
44ac6b484d
...
2725f36017
Author | SHA1 | Date | |
---|---|---|---|
2725f36017 | |||
0af8f2ac5e | |||
6270499efe |
@ -17,7 +17,11 @@ ENV LANGUAGE en_US:en
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
||||
jq && \
|
||||
curl \
|
||||
jq \
|
||||
locales && \
|
||||
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||
locale-gen &&
|
||||
npm install -g --omit=optional --omit=dev \
|
||||
json-server && \
|
||||
npm cache clean --force && \
|
||||
|
@ -55,7 +55,7 @@ data:
|
||||
</body>
|
||||
</html>
|
||||
update.sh: |
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
while getopts u: flag
|
||||
do
|
||||
@ -75,18 +75,18 @@ data:
|
||||
do
|
||||
echo '['$(date "+%Y-%m-%d %H:%M:%S")']' $(curl -ks https://$URL/components | jq length) 'known releases in database'
|
||||
|
||||
echo -n $(helm list --all-namespaces --output json | jq -c '.[]') | while IFS= read -r release;
|
||||
do
|
||||
APP_NAME=$(echo $release | jq -r '.name')
|
||||
for entry in $(helm list --all-namespaces --output json | jq -r '.[] | @base64'); do
|
||||
RELEASE=$(echo $entry | base64 -d)
|
||||
APP_NAME=$(echo $RELEASE | jq -r '.name')
|
||||
APP_ID=$(curl -ks https://$URL/components?name=$APP_NAME | jq -r '.[0].id')
|
||||
|
||||
# Release is not yet in database
|
||||
[ "$APP_ID" == null ] && {
|
||||
curl -ks -X POST https://$URL/components -H 'Content-Type: application/json' --data "$release"
|
||||
curl -ks -X POST https://$URL/components -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
|
||||
}
|
||||
# Release is already in database
|
||||
[ "$APP_ID" != null ] && {
|
||||
curl -ks -X PATCH https://$URL/components/$APP_ID -H 'Content-Type: application/json' --data "$release"
|
||||
curl -ks -X PATCH https://$URL/components/$APP_ID -H 'Content-Type: application/json' --data "$RELEASE" -o /dev/null
|
||||
}
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user