Skip to content

Commit b5eb2b7

Browse files
committed
Also pin repos themselves
1 parent d648c0c commit b5eb2b7

File tree

41 files changed

+55
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+55
-30
lines changed

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ to_upgrade="${2:-git+https://github.com/mkdocs/mkdocs.git}"
1515
info_dir="projects/${repo_name/\//--}"
1616
repo_dir="repos/${repo_name/\//--}"
1717

18-
[[ "$(cat "$info_dir/url.txt")" =~ ^(https://github.com/[^/]+/[^/]+)/raw/([^/]+)/(.+)$ ]]
18+
[[ "$(head -1 "$info_dir/project.txt")" =~ ^https://github.com/([^/]+/[^/]+)/blob/([^/]+)/(.+)$ ]]
1919
repo="${BASH_REMATCH[1]}"
20-
branch="${BASH_REMATCH[2]}"
20+
commit="${BASH_REMATCH[2]}"
2121
mkdocs_yml="${BASH_REMATCH[3]}"
2222

2323

@@ -30,7 +30,7 @@ group() {
3030
setup() {
3131
if ! [[ -d "venv" ]]; then
3232
python -m venv venv
33-
venv/bin/pip install -U -r requirements.txt
33+
venv/bin/pip install -U beautifulsoup4 virtualenv
3434
fi
3535
}
3636

@@ -39,7 +39,7 @@ clone_repo() {
3939
(
4040
cd "$repo_dir/repo"
4141
git init -b checkout
42-
git fetch --depth=1 "$repo" "$branch"
42+
git fetch --depth=1 "https://github.com/$repo" "$commit"
4343
git reset --hard FETCH_HEAD
4444
)
4545
if ! [[ -d "$repo_dir/venv" ]]; then

populate_projects.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ for d in */; do (
88
d="${d%/}"
99
cd "$d"
1010
printf "%s -> " "$d" >&2
11-
if [[ ! -f 'url.txt' ]]; then
12-
repo="https://github.com/${d//--//}"
13-
branch="$(git remote show "$repo" | grep -oP 'HEAD branch: \K.+')"
14-
echo "$repo/raw/$branch/mkdocs.yml" >url.txt
11+
if [[ -f 'project.txt' ]]; then
12+
[[ "$(head -1 'project.txt')" =~ ^https://github.com/([^/]+/[^/]+)/raw/([^/]+)/(.+)$ ]]
13+
repo="${BASH_REMATCH[1]}"
14+
branch="${BASH_REMATCH[2]}"
15+
mkdocs_yml="${BASH_REMATCH[3]}"
16+
else
17+
repo="${d//--//}"
18+
branch=''
19+
mkdocs_yml='mkdocs.yml'
1520
fi
16-
cat url.txt >&2
17-
curl -s -f -L -- $(cat url.txt) | (mkdocs get-deps -f - || true) | grep . >requirements.in
21+
commit=$(curl -sfL "https://api.github.com/repos/$repo/commits?per_page=1&sha=$branch" | jq -r '.[0].sha')
22+
echo "https://github.com/$repo/blob/$branch/$mkdocs_yml" | tee /dev/stderr >project.txt
23+
echo "https://github.com/$repo/raw/$commit/$mkdocs_yml" >>project.txt
24+
tail -1 project.txt | xargs curl -sfL | (mkdocs get-deps -f - || true) | grep . >requirements.in
1825
(cat requirements.extra 2>/dev/null || true) >>requirements.in
1926
); done
2027

projects/Noovolari--leapp/project.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/Noovolari/leapp/blob/master/mkdocs.yml
2+
https://github.com/Noovolari/leapp/raw/11b375de7231a1f15ec95e736e1f779bad3ce6a0/mkdocs.yml

projects/Noovolari--leapp/url.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/Rat-Rig/V-core-3/blob/main/mkdocs.yml
2+
https://github.com/Rat-Rig/V-core-3/raw/4f5d91f42c9a9f7ec346c73728fa6329491aad8c/mkdocs.yml

projects/Rat-Rig--V-core-3/url.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/crystal-lang/crystal-book/blob/master/mkdocs.yml
2+
https://github.com/crystal-lang/crystal-book/raw/f324ebf79204846bfc0c0b0dd5062f4806891618/mkdocs.yml

projects/crystal-lang--crystal-book/url.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/e-maxx-eng/e-maxx-eng/blob/master/mkdocs.yml
2+
https://github.com/e-maxx-eng/e-maxx-eng/raw/86b132438818fdf37fcfaab3e0048663781cc392/mkdocs.yml

projects/e-maxx-eng--e-maxx-eng/url.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)