Skip to content

Commit

Permalink
Also pin repos themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 9, 2023
1 parent d648c0c commit b5eb2b7
Show file tree
Hide file tree
Showing 41 changed files with 55 additions and 30 deletions.
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ to_upgrade="${2:-git+https://github.com/mkdocs/mkdocs.git}"
info_dir="projects/${repo_name/\//--}"
repo_dir="repos/${repo_name/\//--}"

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


Expand All @@ -30,7 +30,7 @@ group() {
setup() {
if ! [[ -d "venv" ]]; then
python -m venv venv
venv/bin/pip install -U -r requirements.txt
venv/bin/pip install -U beautifulsoup4 virtualenv
fi
}

Expand All @@ -39,7 +39,7 @@ clone_repo() {
(
cd "$repo_dir/repo"
git init -b checkout
git fetch --depth=1 "$repo" "$branch"
git fetch --depth=1 "https://github.com/$repo" "$commit"
git reset --hard FETCH_HEAD
)
if ! [[ -d "$repo_dir/venv" ]]; then
Expand Down
19 changes: 13 additions & 6 deletions populate_projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ for d in */; do (
d="${d%/}"
cd "$d"
printf "%s -> " "$d" >&2
if [[ ! -f 'url.txt' ]]; then
repo="https://github.com/${d//--//}"
branch="$(git remote show "$repo" | grep -oP 'HEAD branch: \K.+')"
echo "$repo/raw/$branch/mkdocs.yml" >url.txt
if [[ -f 'project.txt' ]]; then
[[ "$(head -1 'project.txt')" =~ ^https://github.com/([^/]+/[^/]+)/raw/([^/]+)/(.+)$ ]]
repo="${BASH_REMATCH[1]}"
branch="${BASH_REMATCH[2]}"
mkdocs_yml="${BASH_REMATCH[3]}"
else
repo="${d//--//}"
branch=''
mkdocs_yml='mkdocs.yml'
fi
cat url.txt >&2
curl -s -f -L -- $(cat url.txt) | (mkdocs get-deps -f - || true) | grep . >requirements.in
commit=$(curl -sfL "https://api.github.com/repos/$repo/commits?per_page=1&sha=$branch" | jq -r '.[0].sha')
echo "https://github.com/$repo/blob/$branch/$mkdocs_yml" | tee /dev/stderr >project.txt
echo "https://github.com/$repo/raw/$commit/$mkdocs_yml" >>project.txt
tail -1 project.txt | xargs curl -sfL | (mkdocs get-deps -f - || true) | grep . >requirements.in
(cat requirements.extra 2>/dev/null || true) >>requirements.in
); done

Expand Down
2 changes: 2 additions & 0 deletions projects/Noovolari--leapp/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/Noovolari/leapp/blob/master/mkdocs.yml
https://github.com/Noovolari/leapp/raw/11b375de7231a1f15ec95e736e1f779bad3ce6a0/mkdocs.yml
1 change: 0 additions & 1 deletion projects/Noovolari--leapp/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/Rat-Rig--V-core-3/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/Rat-Rig/V-core-3/blob/main/mkdocs.yml
https://github.com/Rat-Rig/V-core-3/raw/4f5d91f42c9a9f7ec346c73728fa6329491aad8c/mkdocs.yml
1 change: 0 additions & 1 deletion projects/Rat-Rig--V-core-3/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/crystal-lang--crystal-book/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/crystal-lang/crystal-book/blob/master/mkdocs.yml
https://github.com/crystal-lang/crystal-book/raw/f324ebf79204846bfc0c0b0dd5062f4806891618/mkdocs.yml
1 change: 0 additions & 1 deletion projects/crystal-lang--crystal-book/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/e-maxx-eng--e-maxx-eng/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/e-maxx-eng/e-maxx-eng/blob/master/mkdocs.yml
https://github.com/e-maxx-eng/e-maxx-eng/raw/86b132438818fdf37fcfaab3e0048663781cc392/mkdocs.yml
1 change: 0 additions & 1 deletion projects/e-maxx-eng--e-maxx-eng/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/emacs-lsp--lsp-mode/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/emacs-lsp/lsp-mode/blob/master/mkdocs.yml
https://github.com/emacs-lsp/lsp-mode/raw/75ea20714635e70ca3da460d1fe558f5057eb373/mkdocs.yml
1 change: 0 additions & 1 deletion projects/emacs-lsp--lsp-mode/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/gledos--ggame/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/gledos/ggame/blob/master/mkdocs.yml
https://github.com/gledos/ggame/raw/ac3cad474b5690484e8ca6ce8a70c14d34555686/mkdocs.yml
1 change: 0 additions & 1 deletion projects/gledos--ggame/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/ikrima--gamedevguide/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/ikrima/gamedevguide/blob/master/mkdocs.yml
https://github.com/ikrima/gamedevguide/raw/3dc28e90b93a435eb6f1aac7149246e3390f11a2/mkdocs.yml
1 change: 0 additions & 1 deletion projects/ikrima--gamedevguide/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/k3d-io--k3d/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/k3d-io/k3d/blob/main/mkdocs.yml
https://github.com/k3d-io/k3d/raw/f73fe36eb0674b9c4b2bc27b36c6dfc8a6151f8c/mkdocs.yml
1 change: 0 additions & 1 deletion projects/k3d-io--k3d/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/librenms--librenms/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/librenms/librenms/blob/master/mkdocs.yml
https://github.com/librenms/librenms/raw/63eeeb71722237d1461a37bb6da99fda25e02c91/mkdocs.yml
1 change: 0 additions & 1 deletion projects/librenms--librenms/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/mkdocs--mkdocs/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/mkdocs/mkdocs/blob/master/mkdocs.yml
https://github.com/mkdocs/mkdocs/raw/dc45916aa1cc4b4d4796dd45656bd1ff60d4ce44/mkdocs.yml
1 change: 0 additions & 1 deletion projects/mkdocs--mkdocs/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/mkdocstrings--mkdocstrings/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/mkdocstrings/mkdocstrings/blob/main/mkdocs.yml
https://github.com/mkdocstrings/mkdocstrings/raw/afc4ea4e178d27c755528f22adb7c1a6fce736f2/mkdocs.yml
1 change: 0 additions & 1 deletion projects/mkdocstrings--mkdocstrings/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/nasa-jpl--open-source-rover/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/nasa-jpl/open-source-rover/blob/master/mkdocs.yml
https://github.com/nasa-jpl/open-source-rover/raw/8f1b426f64efa581a7fc2d9f95b003a25365796a/mkdocs.yml
1 change: 0 additions & 1 deletion projects/nasa-jpl--open-source-rover/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/ni--systemlink-operations-handbook/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/ni/systemlink-operations-handbook/blob/master/mkdocs.yml
https://github.com/ni/systemlink-operations-handbook/raw/94551b22f75a8e611d013326c73849d22282fb3d/mkdocs.yml
1 change: 0 additions & 1 deletion projects/ni--systemlink-operations-handbook/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/ntno--mkdocs-terminal/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/ntno/mkdocs-terminal/blob/main/documentation/mkdocs.yml
https://github.com/ntno/mkdocs-terminal/raw/7d88d64b4dd8175814f79b4989431353a7fe621c/documentation/mkdocs.yml
1 change: 0 additions & 1 deletion projects/ntno--mkdocs-terminal/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/open-amt-cloud-toolkit--docs/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/open-amt-cloud-toolkit/docs/blob/main/mkdocs.yml
https://github.com/open-amt-cloud-toolkit/docs/raw/a9ea9491300e3a9b2fa5db3710b9033bbe69abf9/mkdocs.yml
1 change: 0 additions & 1 deletion projects/open-amt-cloud-toolkit--docs/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/oprypin--mkdocs-gen-files/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/oprypin/mkdocs-gen-files/blob/master/mkdocs.yml
https://github.com/oprypin/mkdocs-gen-files/raw/e5cdd6c044c079a4d8c59b73755c00ace97a2325/mkdocs.yml
1 change: 0 additions & 1 deletion projects/oprypin--mkdocs-gen-files/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/seleniumbase--SeleniumBase/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/seleniumbase/SeleniumBase/blob/master/mkdocs.yml
https://github.com/seleniumbase/SeleniumBase/raw/62e7a043636f4fbe5804fb8f4684eeb6224a51f2/mkdocs.yml
1 change: 0 additions & 1 deletion projects/seleniumbase--SeleniumBase/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/spaceship-prompt--spaceship-prompt/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/spaceship-prompt/spaceship-prompt/blob/master/mkdocs.yml
https://github.com/spaceship-prompt/spaceship-prompt/raw/be826cbe2bb11a0675dd71f548ff1396608da7ea/mkdocs.yml
1 change: 0 additions & 1 deletion projects/spaceship-prompt--spaceship-prompt/url.txt

This file was deleted.

2 changes: 2 additions & 0 deletions projects/tfeldmann--organize/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/tfeldmann/organize/blob/main/mkdocs.yml
https://github.com/tfeldmann/organize/raw/0d254e984e555094b0958d2f8733b91ebc5fe641/mkdocs.yml
1 change: 0 additions & 1 deletion projects/tfeldmann--organize/url.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
beautifulsoup4
mkdocs
pip-tools
pyyaml
virtualenv

0 comments on commit b5eb2b7

Please sign in to comment.