diff --git a/DIRECTORY_TREE.md b/DIRECTORY_TREE.md index 19c9a0d..5c058a8 100644 --- a/DIRECTORY_TREE.md +++ b/DIRECTORY_TREE.md @@ -2,6 +2,9 @@
. +├─ archive +│ ├─ README.md +│ └─ round-robin.md ├─ bash_scripts │ ├─ README.en.md │ ├─ README.md @@ -15,14 +18,11 @@ │ ├─ repo_gitlab.tmpl.sh │ ├─ repo_local.tmpl.sh │ └─ repo_orchestrate.sh -├─ draft -│ ├─ README.md -│ └─ round-robin.md ├─ pictures │ ├─ README.md +│ ├─ archive.jpg │ ├─ bash_scripts.jpg │ ├─ color-tomato-theme.jpg -│ ├─ draft.jpg │ ├─ older-tomato-theme.jpg │ ├─ pictures.jpg │ ├─ pomodoro.jpg diff --git a/README.en.md b/README.en.md index e61ad70..fcabec8 100644 --- a/README.en.md +++ b/README.en.md @@ -31,8 +31,8 @@ AngularJS and Material, this was the design of the previous version of my blog, default design theme on GitHub Pages. Both tomatoes supplement each other and are similar to each other, so they can be used together on the same site. -- [Color tomato](https://hub.mos.ru/golovin/color-tomato-theme/blob/master/README.en.md) — color selection during the build. -- [Older tomato](https://hub.mos.ru/golovin/older-tomato-theme/blob/master/README.en.md) — lightweight decoration theme. +- [Color tomato](https://git.org.ru/golovin/color-tomato-theme/src/branch/master/README.en.md) — color selection during the build. +- [Older tomato](https://git.org.ru/golovin/older-tomato-theme/src/branch/master/README.en.md) — lightweight decoration theme. ### Process @@ -40,8 +40,8 @@ The creative process began in 2016, but even earlier I wrote some things for mys creativity occurs, when there is no work. Mature thoughts become separate projects, and immature ones go as parts of this project. Over time, there are more parts, so automation comes in handy here too. +- [Incomplete publications](archive/README.md) — archive without translation. - [Process management](bash_scripts/README.en.md) — scripts Bash. -- [Incomplete publications](draft/README.md) — draft without translation. - [Avatars for repositories](pictures/README.md) — pictures. ### Build diff --git a/README.md b/README.md index 6ed552e..1a5733d 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ внешний вид напоминает тему оформления по умолчанию на GitHub Pages. Оба помидора дополняют друг друга и похожи друг на друга, поэтому их можно использовать вместе на одном сайте. -- [Цветной помидор](https://hub.mos.ru/golovin/color-tomato-theme/blob/master/README.md) — выбор цвета во время сборки. -- [Старый помидор](https://hub.mos.ru/golovin/older-tomato-theme/blob/master/README.md) — легковесная тема оформления. +- [Цветной помидор](https://git.org.ru/golovin/color-tomato-theme/src/branch/master/README.md) — выбор цвета во время сборки. +- [Старый помидор](https://git.org.ru/golovin/older-tomato-theme/src/branch/master/README.md) — легковесная тема оформления. ### Процесс @@ -39,8 +39,8 @@ наступает, когда работы нет. Созревшие мысли становятся отдельными проектами, а несозревшие идут как части этого проекта. Со временем частей становится больше, поэтому автоматизация пригождается и здесь тоже. +- [Незавершённые публикации](archive/README.md) — архив. - [Управление процессами](bash_scripts/README.md) — скрипты Bash. -- [Незавершённые публикации](draft/README.md) — черновик. - [Аватарки для репозиториев](pictures/README.md) — картинки. ### Сборка diff --git a/WIKI.md b/WIKI.md index 7f1ddf6..47474a7 100644 --- a/WIKI.md +++ b/WIKI.md @@ -23,7 +23,7 @@ - [Поворот матрицы на 90 градусов](https://pomodoro3.mircloud.ru/ru/2021/12/12/matrix-rotation-90-degrees.html) — 12.12.2021. - [Оптимизация умножения матриц](https://pomodoro3.mircloud.ru/ru/2021/12/09/optimizing-matrix-multiplication.html) — 09.12.2021. 4. Практическая философия, поэзия и юмор. - - [Абстрактная модель работы мечты](https://pomodoro4.mircloud.ru/ru/2023/12/31/dream-job-abstract-model.html) — 31.12.2023. + - [Алгоритм поиска работы мечты](https://pomodoro4.mircloud.ru/ru/2023/12/31/dream-job-searching-algorithm.html) — 31.12.2023. - [Поэзия начала 20 века](https://pomodoro4.mircloud.ru/ru/2022/01/07/poetry-early-20th-century.html) — 07.01.2022. - [История про лес, название утеряно](https://pomodoro4.mircloud.ru/ru/2022/01/05/forest-story-title-lost.html) — 05.01.2022. 5. Рисуем картинки текстом. diff --git a/draft/README.md b/archive/README.md similarity index 100% rename from draft/README.md rename to archive/README.md diff --git a/draft/round-robin.md b/archive/round-robin.md similarity index 100% rename from draft/round-robin.md rename to archive/round-robin.md diff --git a/bash_scripts/README.en.md b/bash_scripts/README.en.md index 201ca18..cd65ee4 100644 --- a/bash_scripts/README.en.md +++ b/bash_scripts/README.en.md @@ -25,13 +25,13 @@ of the repositories remain with the user. The directory structure for. -├─ color-tomato-theme -├─ older-tomato-theme -├─ pomodoro -├─ pomodoro1 -├─ pomodoro2 -├─ pomodoro3 -├─ pomodoro4 -├─ pomodoro5 -└─ pomodoro6 +├─ color-tomato-theme +├─ older-tomato-theme +├─ pomodoro +├─ pomodoro1 +├─ pomodoro2 +├─ pomodoro3 +├─ pomodoro4 +├─ pomodoro5 +└─ pomodoro6diff --git a/bash_scripts/README.md b/bash_scripts/README.md index a6e2aad..2e3ccfc 100644 --- a/bash_scripts/README.md +++ b/bash_scripts/README.md @@ -25,13 +25,13 @@. -├─ color-tomato-theme -├─ older-tomato-theme -├─ pomodoro -├─ pomodoro1 -├─ pomodoro2 -├─ pomodoro3 -├─ pomodoro4 -├─ pomodoro5 -└─ pomodoro6 +├─ color-tomato-theme +├─ older-tomato-theme +├─ pomodoro +├─ pomodoro1 +├─ pomodoro2 +├─ pomodoro3 +├─ pomodoro4 +├─ pomodoro5 +└─ pomodoro6diff --git a/bash_scripts/archive_backup.sh b/bash_scripts/archive_backup.sh index 6c784bc..69f5a20 100755 --- a/bash_scripts/archive_backup.sh +++ b/bash_scripts/archive_backup.sh @@ -4,5 +4,4 @@ cd ../.. filename="pomodoro-$(date '+%Y-%m-%d').zip" rm -rf "$filename" 7z a -tzip -ssw -mx9 -r0 "$filename" ./* -xr!".idea" -xr!".git" -x!"*.iml" \ - -x!"*.gem" -x!"*.lock" -x!"*.zip" -x!"_site*" -x!".token_*" -x!".repo_*" \ - -xr!"DIRECTORY_TREE.md" -xr!"CONTRIBUTING.md" -x!"*LICENSE*" + -x!"*.gem" -x!"*.lock" -x!"*.zip" -x!"_site*" -x!".token_*" -x!".repo_*" diff --git a/bash_scripts/info_param.sh b/bash_scripts/info_param.sh index 57f3cb2..d3ddfe5 100755 --- a/bash_scripts/info_param.sh +++ b/bash_scripts/info_param.sh @@ -1,4 +1,5 @@ #!/bin/bash -#remote="git.org.ru" -remote="hub.mos.ru" +#remote="gitea.com" +remote="git.org.ru" +#remote="hub.mos.ru" echo "Переключение домена удалённого репозитория: $remote" diff --git a/bash_scripts/info_references.sh b/bash_scripts/info_references.sh index 475d3e9..5df5f86 100755 --- a/bash_scripts/info_references.sh +++ b/bash_scripts/info_references.sh @@ -1,18 +1,27 @@ #!/bin/bash echo "Обновление домена удалённого репозитория в перекрёстных ссылках в описаниях." remote="git.org.ru" && source info_param.sh +# экранируем точки в названии домена +domain="${remote//"."/"\."}" +# название домена в верхнем регистре +DOMAIN="${domain^^}" cd ../.. # выходим из папки и из репозитория # обходим все репозитории, расположенные на одном уровне с текущим find . -type f -name 'README*.md' | sort -r | while read -r file; do echo "$remote => $file" - # заменяем git.org.ru => hub.mos.ru => иначе наоборот + # сбрасываем значения параметров + sed -i 's/gitea\.com/tmp_stub/g' "$file" + sed -i 's/GITEA\.COM/TMP_STUB/g' "$file" + sed -i 's/git\.org\.ru/tmp_stub/g' "$file" + sed -i 's/GIT\.ORG\.RU/TMP_STUB/g' "$file" + sed -i 's/hub\.mos\.ru/tmp_stub/g' "$file" + sed -i 's/HUB\.MOS\.RU/TMP_STUB/g' "$file" + # устанавливаем значения параметров + sed -i 's/tmp_stub/'$domain'/g' "$file" + sed -i 's/TMP_STUB/'$DOMAIN'/g' "$file" if [ "$remote" == "hub.mos.ru" ]; then - sed -i 's/git\.org\.ru/hub\.mos\.ru/g' "$file" - sed -i 's/GIT\.ORG\.RU/HUB\.MOS\.RU/g' "$file" sed -i 's/src\/branch/blob/g' "$file" else - sed -i 's/hub\.mos\.ru/git\.org\.ru/g' "$file" - sed -i 's/HUB\.MOS\.RU/GIT\.ORG\.RU/g' "$file" sed -i 's/blob/src\/branch/g' "$file" fi done diff --git a/bash_scripts/repo_compose.sh b/bash_scripts/repo_compose.sh index cfa90e6..6ede232 100755 --- a/bash_scripts/repo_compose.sh +++ b/bash_scripts/repo_compose.sh @@ -46,12 +46,12 @@ find . -mindepth 1 -maxdepth 1 -type d | sort -r | while read -r dir; do fi description+=" — https://$owner$repo.mircloud.ru" else - description="Серия статических вёб-сайтов / Описание и оглавление" + description="Описание и оглавление" fi elif [[ "$dir" =~ "color-tomato" ]]; then - description="Цветной помидор / Тема оформления Jekyll" + description="Тема оформления / Цветной помидор" elif [[ "$dir" =~ "older-tomato" ]]; then - description="Старый помидор / Тема оформления Jekyll" + description="Тема оформления / Старый помидор" fi # скрипт для создания удалённого репозитория { diff --git a/bash_scripts/repo_gitea.tmpl.sh b/bash_scripts/repo_gitea.tmpl.sh index c1ec6d3..e0519a4 100644 --- a/bash_scripts/repo_gitea.tmpl.sh +++ b/bash_scripts/repo_gitea.tmpl.sh @@ -61,17 +61,17 @@ if [ -z "$1" ] || [ "$1" == "options" ]; then \"has_pull_requests\": false, \"has_releases\": false, \"has_wiki\": $has_wiki }" -i -## Метод API появился в версии 1.21.0 -# echo "Добавление аватарки для репозитория." -# picture=$repo -# if [ "$type" == "org" ]; then -# picture="website" -# fi -# avatar=$(basenc "../pomodoro/pictures/$picture.jpg" --base64 -w0) -# curl -X POST "https://$remote/api/v1/repos/$owner/$repo/avatar" \ -# -H "Authorization: token $token" \ -# -H "Accept: application/json" \ -# -H "Content-Type: application/json" -d "{ \"image\": \"$avatar\" }" -i + # Метод API появился в версии 1.21.0 + echo "Добавление аватарки для репозитория." + picture=$repo + if [ "$type" == "org" ]; then + picture="website" + fi + avatar=$(basenc "../pomodoro/pictures/$picture.jpg" --base64 -w0) + curl -X POST "https://$remote/api/v1/repos/$owner/$repo/avatar" \ + -H "Authorization: token $token" \ + -H "Accept: application/json" \ + -H "Content-Type: application/json" -d "{ \"image\": \"$avatar\" }" -i if [ "$1" ]; then exit 0 fi diff --git a/bash_scripts/repo_orchestrate.sh b/bash_scripts/repo_orchestrate.sh index f3f0e88..22c8a90 100755 --- a/bash_scripts/repo_orchestrate.sh +++ b/bash_scripts/repo_orchestrate.sh @@ -11,7 +11,7 @@ find .. -mindepth 1 -maxdepth 1 -type d -printf \ 'cd %h/%f && ./.repo_remote.sh "delete" >.repo_remote.log\0' | xargs -L1 -0 -P0 bash -c # 2 Создание репозиториев на сервере find .. -mindepth 1 -maxdepth 1 -type d -printf \ - 'cd %h/%f && ./.repo_remote.sh "create" >>.repo_remote.log\0' | xargs -L1 -0 -P0 bash -c + 'cd %h/%f && ./.repo_remote.sh "create" >>.repo_remote.log\0' | xargs -L1 -0 -P2 bash -c # 3 Создание локальных репозиториев и отправка данных на сервер # 4 Изменение настроек репозиториев на сервере, отключение ненужного find .. -mindepth 1 -maxdepth 1 -type d -printf \ diff --git a/pictures/README.md b/pictures/README.md index 061834f..b10fadb 100644 --- a/pictures/README.md +++ b/pictures/README.md @@ -11,7 +11,7 @@ |  | | bash_scripts | |  | -| draft | -|  | +| archive | +|  | | pictures | |  | diff --git a/pictures/draft.jpg b/pictures/archive.jpg similarity index 100% rename from pictures/draft.jpg rename to pictures/archive.jpg