Skip to content

Commit ddafca8

Browse files
authored
Merge branch 'main' into dependabot/docker/aws-cli/amazonlinux/amazonlinux-2023.8.20250818.0-minimal
2 parents 93aebc1 + 66adf2c commit ddafca8

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

aws-cli/bump-apk-versions.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
# shellcheck shell=dash
3+
4+
set -euo pipefail
5+
6+
cd "$(\dirname "${0}")"
7+
8+
if [ -f /.dockerenv ]; then
9+
10+
\apk update
11+
12+
\apk add perl
13+
14+
u=$(\apk -u list | \tr '\n' '|')
15+
16+
\rm -f .bump.csv.bak
17+
\sed -e :a -e '/\\$/N; s/\\\n//; ta' Dockerfile | \grep -o -e 'apk[^\&\;]*add[^\&\;]*' | \grep -o -e '[^ ]*=[^ ]*' | while IFS= read -r l; do
18+
p="${l%=*}"
19+
v1="${l#*=}"
20+
v="$(echo "|${u}" | \grep -o -e "\|${p}-[^\|]*upgradable from: ${p}-${v1}" || true)"
21+
if [ -z "${v}" ]; then
22+
continue
23+
fi
24+
n=$(($(echo -n "${p}" | wc -c) + 2))
25+
v2="$(echo "${v}" | \cut -d ' ' -f 1 | \cut -c ${n}-)"
26+
if [ -n "${v2}" ] && [ "${v2}" != "${v1}" ]; then
27+
echo "${p} ${v1} -> ${v2}"
28+
echo "${p},${v1},${v2},${p}=${v1},${p}=${v2}" >>.bump.csv.bak
29+
fi
30+
done
31+
32+
else
33+
34+
\docker run --pull always --rm -t --user root -v "$(pwd):/opt/bump" "leplusorg/${PWD##*/}:main" /opt/bump/"$(\basename "${0}")"
35+
36+
./create-bump-prs.sh
37+
38+
fi

aws-cli/create-bump-prs.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
32
set -euo pipefail
3+
IFS=$'\n\t'
44

55
cd "$(\dirname "${0}")"
66

@@ -9,18 +9,21 @@ if [ -f .bump.csv.bak ]; then
99
>&2 echo "error: git repo contains uncommitted changes"
1010
exit 1
1111
fi
12+
\git pull
1213
csv="$(\cat .bump.csv.bak)"
1314
\rm -f .bump.csv.bak
14-
while IFS="," read -r p v1 v2 l1 l2; do
15+
while IFS=',' read -r p v1 v2 l1 l2; do
1516
b="${p}-${v2//[\~\:]/-}"
1617
\git switch --create "${b}"
1718
\perl -i -p -e "s|\Q${l1}\E|${l2}|g" Dockerfile
1819
\git add Dockerfile
1920
\git commit -S -m "build(deps): bump ${p} from ${v1} to ${v2}"
20-
echo "Please review and push commit in branch \"${b}\". Waiting..."
21-
while \git status | \grep -Fq "Your branch is ahead"; do
21+
echo -n "Please review and push commit in branch \"${b}\". Waiting..."
22+
while [ "$(git rev-list --count --right-only 'origin...HEAD')" -gt 0 ]; do
2223
\sleep 1
24+
\echo -n .
2325
done
26+
\echo
2427
\gh pr create -f -l build -l dependencies
2528
\git checkout -
2629
done <<<"${csv}"

0 commit comments

Comments
 (0)