Skip to content

Commit

Permalink
Merge pull request #12 from slashdevops/develop
Browse files Browse the repository at this point in the history
fix: tools scripts
  • Loading branch information
christiangda authored Aug 22, 2021
2 parents 273e38b + c015081 commit 870c9e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
12 changes: 10 additions & 2 deletions docs/FILES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Package Content Information\n\nThe content of this files is auto-generated using the bash script [fill_pkg_info.sh](../tools/fill_pkg_info.sh)\n\n## tree \n\n```text\npkg
# Package Content Information

The content of this files is auto-generated using the bash script [fill_pkg_info.sh](../tools/fill_pkg_info.sh)

## tree

```text
pkg
├── Kptfile
├── README.md
├── instance
Expand Down Expand Up @@ -167,4 +174,5 @@
├── bundle.yaml
└── kustomization.yaml
33 directories, 134 files\n```
33 directories, 134 files
```
7 changes: 6 additions & 1 deletion docs/VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Container image versions\n\nThe content of this files is auto-generated using the bash script [fill_versions.sh](../tools/fill_versions.sh)\n\n| Image | Version | Package Manifest |\n| ----- | ------- | ---------------- |
# Container image versions

The content of this files is auto-generated using the bash script [fill_versions.sh](../tools/fill_versions.sh)

| Image | Version | Package Manifest |
| ----- | ------- | ---------------- |
| k8s.gcr.io/kube-state-metrics/kube-state-metrics | v2.0.0 | pkg/upstream/kube-state-metrics/deployment.yaml |
| quay.io/prometheus/alertmanager | v0.22.1 | pkg/upstream/alertmanager/alertmanager.yaml |
| quay.io/prometheus-operator/prometheus-operator | v0.47.1 | pkg/upstream/prometheus-operator/bundle.yaml |
Expand Down
2 changes: 1 addition & 1 deletion tools/fill_pkg_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ CONTENT+="$PKG_COUNT\n"

CONTENT+="\`\`\`"

echo "$CONTENT" > $MD_FILE
printf "$CONTENT" > $MD_FILE
6 changes: 3 additions & 3 deletions tools/fill_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ CONTENT+="\n"
CONTENT+="The content of this files is auto-generated using the bash script [fill_versions.sh](../tools/fill_versions.sh)\n"
CONTENT+="\n"
CONTENT+="| Image | Version | Package Manifest |\n"
CONTENT+="| ----- | ------- | ---------------- |"
echo "$CONTENT" > $MD_FILE
CONTENT+="| ----- | ------- | ---------------- |\n"
printf "$CONTENT" > $MD_FILE

grep -R "image: " $UPSTREAM_PATH | awk -F":" '{print $1 " " $3 " " $4}' | while read MANIFEST IMAGE VERSION
do
# Find version for prometheus and alertmanager
if [[ "$IMAGE" =~ (alertmanager|prometheus)$ ]]; then
VERSION=$(grep "version: " $MANIFEST | awk -F" " '{print $2}')
fi
echo "| $IMAGE | $VERSION | $MANIFEST |" >> $MD_FILE
printf "| $IMAGE | $VERSION | $MANIFEST |\n" >> $MD_FILE
done

0 comments on commit 870c9e0

Please sign in to comment.