10 Commits

Author SHA1 Message Date
b432068e82 chore(release): 0.8.3 [skip ci]
## [0.8.3](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.2...v0.8.3) (2023-07-16)

### Bug Fixes

* Filter redundant release fields ([16f1ff1](16f1ff14ff))
2023-07-16 12:51:31 +00:00
16f1ff14ff fix: Filter redundant release fields
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 14:49:12 +02:00
15daa960c2 chore(release): 0.8.2 [skip ci]
## [0.8.2](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.1...v0.8.2) (2023-07-16)

### Bug Fixes

* Remove race condition when testing target url ([105bc71](105bc71e9c))
* Set filemode per key ([a6d6e91](a6d6e91ffa))
2023-07-16 09:48:56 +00:00
105bc71e9c fix: Remove race condition when testing target url
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 11:46:17 +02:00
a6d6e91ffa fix: Set filemode per key 2023-07-16 11:45:19 +02:00
e8822fc8da chore(release): 0.8.1 [skip ci]
## [0.8.1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.0...v0.8.1) (2023-07-14)

### Bug Fixes

* Add missing dependency ([6270499](6270499efe))
* Fix linebreak ([fa2c72c](fa2c72cb68))
* Refactor update script for bash interpreter ([2725f36](2725f36017))
* Workaround for set locale warning ([0af8f2a](0af8f2ac5e))
2023-07-14 13:29:52 +00:00
fa2c72cb68 fix: Fix linebreak
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-14 15:27:18 +02:00
2725f36017 fix: Refactor update script for bash interpreter
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-14 15:25:42 +02:00
0af8f2ac5e fix: Workaround for set locale warning 2023-07-14 15:25:00 +02:00
6270499efe fix: Add missing dependency 2023-07-14 14:57:31 +02:00
4 changed files with 47 additions and 11 deletions

View File

@ -1,3 +1,28 @@
## [0.8.3](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.2...v0.8.3) (2023-07-16)
### Bug Fixes
* Filter redundant release fields ([16f1ff1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/16f1ff14ff4616b28462715ce2d6fd6490254b10))
## [0.8.2](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.1...v0.8.2) (2023-07-16)
### Bug Fixes
* Remove race condition when testing target url ([105bc71](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/105bc71e9c16ebf9afa5a4027d1131f311a76c5e))
* Set filemode per key ([a6d6e91](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/a6d6e91ffadd13650c0ce44d0c43e96dea3c6711))
## [0.8.1](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.8.0...v0.8.1) (2023-07-14)
### Bug Fixes
* Add missing dependency ([6270499](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/6270499efecb8ae1474f1ce29c8f4003da3916df))
* Fix linebreak ([fa2c72c](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/fa2c72cb68254dd0e27f12220f8056b9223223ed))
* Refactor update script for bash interpreter ([2725f36](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/2725f360179b3dab1d77d5f429b2f60d4aabcd4a))
* Workaround for set locale warning ([0af8f2a](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/commit/0af8f2ac5ea0f8453fdb7120aeb7eff15aa88e42))
# [0.8.0](https://code.spamasaurus.com/djpbessems/ContainerImage.JSONServer/compare/v0.7.3...v0.8.0) (2023-07-14)

View File

@ -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 && \

View File

@ -55,7 +55,7 @@ data:
</body>
</html>
update.sh: |
#!/bin/sh
#!/bin/bash
while getopts u: flag
do
@ -64,8 +64,8 @@ data:
esac
done
[ $(curl -kLs -w "%{http_code}" -o /dev/null https://$URL) != 200 ] && {
echo 'Could not connect to' $URL
[[ $(getent hosts $URL) ]] || {
echo 'Could not resolve' $URL
exit 1
}
@ -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 | jq -cS '.type="helm" | del(.namespace, .revision, .status)')
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

View File

@ -60,18 +60,25 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
command:
- /bin/sh
- /bin/bash
- -c
- "/opt/update.sh -u {{ .Values.sidecar.targetUrl }}"
volumeMounts:
- name: {{ .Release.Name }}-configmap
mountPath: /opt/update.sh
subPath: update.sh
defaultMode: 0744
volumes:
- name: {{ .Release.Name }}-configmap
configMap:
name: {{ .Release.Name }}-configmap
items:
- key: db.json
path: db.json
- key: index.html
path: index.html
- key: update.sh
path: update.sh
mode: 0744
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}