Skip to content

Commit

Permalink
added some observability
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer committed Sep 17, 2023
1 parent dcdf845 commit d47190e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package/usr/bin/gitaptly_serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ owner=$(echo "$path" | rev | cut -d/ -f3 | rev)

echo "Content-Type: application/vnd.debian.binary-package"
echo ""
otel_observe wget -O - $(bash /usr/bin/gitaptly_scan.sh $owner $repo | (grep "$file"'$' || true) | head --lines=1)
wget -O - $(bash /usr/bin/gitaptly_scan.sh $owner $repo | (grep "$file"'$' || true) | head --lines=1)
12 changes: 6 additions & 6 deletions package/usr/bin/gitaptly_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ if [ "$MODE" = 'cache' ]; then
owner=$(echo $line | cut -d "/" -f 1)
repo=$(echo $line | cut -d "/" -f 2)
mkdir -p pool/main/$owner/$repo
otel_observe wget -q -nc -P pool/main/$owner/$repo $(bash /usr/bin/gitaptly_scan.sh $owner $repo) || true
wget -q -nc -P pool/main/$owner/$repo $(bash /usr/bin/gitaptly_scan.sh $owner $repo) || true
done < /etc/gitaptly.conf
otel_observe dpkg-scanpackages --multiversion pool/ > dists/stable/main/binary-all/Packages
dpkg-scanpackages --multiversion pool/ > dists/stable/main/binary-all/Packages

elif [ "$MODE" = 'proxy' ]; then
while read line; do
Expand All @@ -43,8 +43,8 @@ elif [ "$MODE" = 'proxy' ]; then
if [ -f pool/main/$owner/$repo/$file ]; then
continue
fi
otel_observe wget -q -nc -O pool/main/$owner/$repo/$file $url
otel_observe dpkg-scanpackages --multiversion pool/main/$owner/$repo/$file | sed "s/Filename: .*/Filename: cgi-bin\/main\/$owner\/$repo\/$file/" >> dists/stable/main/binary-all/Packages
wget -q -nc -O pool/main/$owner/$repo/$file $url
dpkg-scanpackages --multiversion pool/main/$owner/$repo/$file | sed "s/Filename: .*/Filename: cgi-bin\/main\/$owner\/$repo\/$file/" >> dists/stable/main/binary-all/Packages
rm pool/main/$owner/$repo/$file
ln --symbolic /usr/bin/gitaptly_serve.sh pool/main/$owner/$repo/$file
done
Expand All @@ -54,5 +54,5 @@ else
exit 1
fi

otel_observe gzip -9 < dists/stable/main/binary-all/Packages > dists/stable/main/binary-all/Packages.gz
otel_observe bash /usr/bin/gitaptly_create_release.sh dists/stable > dists/stable/Release
gzip -9 < dists/stable/main/binary-all/Packages > dists/stable/main/binary-all/Packages.gz
bash /usr/bin/gitaptly_create_release.sh dists/stable > dists/stable/Release

0 comments on commit d47190e

Please sign in to comment.