1
0
Fork 0

2023-09-30

This commit is contained in:
Gennadiy 2023-12-17 08:46:48 +03:00
parent 9be39efc35
commit 0e7f1419da
14 changed files with 59 additions and 66 deletions

View file

@ -14,7 +14,7 @@
│ ├─ <a href='bash_scripts/repo_gitea.tmpl.sh'>repo_gitea.tmpl.sh</a>
│ ├─ <a href='bash_scripts/repo_gitlab.tmpl.sh'>repo_gitlab.tmpl.sh</a>
│ ├─ <a href='bash_scripts/repo_local.tmpl.sh'>repo_local.tmpl.sh</a>
│ └─ <a href='bash_scripts/repo_update.sh'>repo_update.sh</a>
│ └─ <a href='bash_scripts/repo_orchestrate.sh'>repo_orchestrate.sh</a>
├─ <a href='draft'>draft</a>
│ ├─ <a href='draft/README.md'>README.md</a>
│ └─ <a href='draft/round-robin.md'>round-robin.md</a>
@ -25,8 +25,8 @@
│ ├─ <a href='pictures/draft.jpg'>draft.jpg</a>
│ ├─ <a href='pictures/older-tomato-theme.jpg'>older-tomato-theme.jpg</a>
│ ├─ <a href='pictures/pictures.jpg'>pictures.jpg</a>
│ ├─ <a href='pictures/pomodoro-website.jpg'>pomodoro-website.jpg</a>
│ └─ <a href='pictures/pomodoro.jpg'>pomodoro.jpg</a>
│ ├─ <a href='pictures/pomodoro.jpg'>pomodoro.jpg</a>
│ └─ <a href='pictures/website.jpg'>website.jpg</a>
├─ <a href='.gitattributes'>.gitattributes</a>
├─ <a href='.gitignore'>.gitignore</a>
├─ <a href='CONTRIBUTING.md'>CONTRIBUTING.md</a>

View file

@ -20,7 +20,7 @@ intentionally and, secondly, not all of them — are mistakes.
1. [Three-dimensional graphics in JavaScript](https://pomodoro1.mircloud.ru/en/).
2. [Cartesian product, combinatorics](https://pomodoro2.mircloud.ru/en/).
3. [Matrix multiplication and rotations](https://pomodoro3.mircloud.ru/en/).
4. [Psychology, poetry and humor without translation](https://pomodoro4.mircloud.ru/).
4. [Philosophy, poetry and humor without translation](https://pomodoro4.mircloud.ru/).
5. [Drawing pictures with text](https://pomodoro5.mircloud.ru/en/).
### Design

View file

@ -19,7 +19,7 @@
1. [Трёхмерная графика на JavaScript](https://pomodoro1.mircloud.ru).
2. [Декартово произведение, комбинаторика](https://pomodoro2.mircloud.ru).
3. [Умножение матриц и повороты](https://pomodoro3.mircloud.ru).
4. [Психология, поэзия и юмор](https://pomodoro4.mircloud.ru).
4. [Философия, поэзия и юмор](https://pomodoro4.mircloud.ru).
5. [Рисуем картинки текстом](https://pomodoro5.mircloud.ru).
### Оформление

View file

@ -22,8 +22,8 @@
- [Поворот матрицы на 180 градусов](https://pomodoro3.mircloud.ru/ru/2021/12/16/matrix-rotation-180-degrees.html) — 16.12.2021.
- [Поворот матрицы на 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. Психология, поэзия и юмор.
- Алгоритм поиска работы мечты — 31.12.2023.
4. Философия, поэзия и юмор.
- [Алгоритм поиска работы мечты](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. Рисуем картинки текстом.
@ -59,7 +59,7 @@
- [Matrix rotation 180 degrees](https://pomodoro3.mircloud.ru/en/2021/12/17/matrix-rotation-180-degrees.html) — 17.12.2021.
- [Matrix rotation 90 degrees](https://pomodoro3.mircloud.ru/en/2021/12/13/matrix-rotation-90-degrees.html) — 13.12.2021.
- [Optimizing matrix multiplication](https://pomodoro3.mircloud.ru/en/2021/12/10/optimizing-matrix-multiplication.html) — 10.12.2021.
4. Psychology, poetry and humor without translation.
4. Philosophy, poetry and humor without translation.
5. Drawing pictures with text.
- [Directory tree with links](https://pomodoro5.mircloud.ru/en/2023/08/04/directory-tree.html) — 04.08.2023.
- [Password generator](https://pomodoro5.mircloud.ru/en/2023/06/20/password-generator.html) — 20.06.2023.

View file

@ -2,25 +2,25 @@
Creating an archive, switching the domain, composing scripts and creating repositories for publishing.
| № | Bash scripts | Actions performed |
|---|:---------------------------------------------|:--------------------------------------------------------------------------------------------|
| 1 | [**archive_backup.sh**](archive_backup.sh) | Creating a common archive for the directories of projects on the current date. |
| | [archive_packages.sh](archive_packages.sh) | Building websites, creating and copying archives for deployment. |
| 2 | [**info_param.sh**](info_param.sh) | Parameter for other scripts. Switching the domain of the remote repository. |
| | [info_references.sh](info_references.sh) | Updating the domain of a remote repository in cross-references in descriptions. |
| | [info_tree_license.sh](info_tree_license.sh) | Building a directory tree for each project and copying license files. |
| 3 | [**repo_compose.sh**](repo_compose.sh) | Composing scripts with parameters and copying them to the directories of projects. |
| | [repo_gitea.tmpl.sh](repo_gitea.tmpl.sh) | Script template without parameters to create a remote repository gitea. |
| | [repo_gitlab.tmpl.sh](repo_gitlab.tmpl.sh) | Script template without parameters to create a remote repository gitlab. |
| | [repo_local.tmpl.sh](repo_local.tmpl.sh) | Script template without parameters to create a local repository. |
| 4 | [**repo_update.sh**](repo_update.sh) | Parallel execution of scripts and creation of repositories for the directories of projects. |
| № | Bash scripts | Actions performed |
|---|:-----------------------------------------------|:--------------------------------------------------------------------------------------------|
| 1 | [**archive_backup.sh**](archive_backup.sh) | Creating a common archive for the directories of projects on the current date. |
| | [archive_packages.sh](archive_packages.sh) | Building websites, creating and copying archives for deployment. |
| 2 | [**info_param.sh**](info_param.sh) | Parameter for other scripts. Switching the domain of the remote repository. |
| | [info_references.sh](info_references.sh) | Updating the domain of a remote repository in cross-references in descriptions. |
| | [info_tree_license.sh](info_tree_license.sh) | Building a directory tree for each project and copying license files. |
| 3 | [**repo_compose.sh**](repo_compose.sh) | Composing scripts with parameters and copying them to the directories of projects. |
| | [repo_gitea.tmpl.sh](repo_gitea.tmpl.sh) | Script template without parameters to create a remote repository gitea. |
| | [repo_gitlab.tmpl.sh](repo_gitlab.tmpl.sh) | Script template without parameters to create a remote repository gitlab. |
| | [repo_local.tmpl.sh](repo_local.tmpl.sh) | Script template without parameters to create a local repository. |
| 4 | [**repo_orchestrate.sh**](repo_orchestrate.sh) | Parallel execution of scripts and creation of repositories for the directories of projects. |
## Directories of projects
Local project directories are located on the same level. On the server,
repositories with websites are moved to a separate group, and the rest
of the repositories remain with the user. The directory structure for
[gitea&period;com](https://gitea&period;com/golovin) and
[git&period;org&period;ru](https://git&period;org&period;ru/golovin) and
[hub&period;mos&period;ru](https://hub&period;mos&period;ru/golovin).
<pre>
@ -35,7 +35,3 @@ of the repositories remain with the user. The directory structure for
├─ <a href='https://hub.mos.ru/pomodoro/5/blob/master/DIRECTORY_TREE.md'>pomodoro5</a>
└─ <a href='https://hub.mos.ru/pomodoro/6/blob/master/DIRECTORY_TREE.md'>pomodoro6</a>
</pre>
---
© Golovin G.G., Code with comments, translation from Russian, 2021-2023

View file

@ -2,25 +2,25 @@
Создание архива, переключение домена, составление скриптов и создание репозиториев для публикации.
| № | Скрипты Bash | Выполняемые действия |
|---|:---------------------------------------------|:---------------------------------------------------------------------------------|
| 1 | [**archive_backup.sh**](archive_backup.sh) | Создание общего архива для каталогов проектов на текущую дату. |
| | [archive_packages.sh](archive_packages.sh) | Сборка вёб-сайтов, создание и копирование архивов для развёртывания. |
| 2 | [**info_param.sh**](info_param.sh) | Параметр для других скриптов. Переключение домена удалённого репозитория. |
| | [info_references.sh](info_references.sh) | Обновление домена удалённого репозитория в перекрёстных ссылках в описаниях. |
| | [info_tree_license.sh](info_tree_license.sh) | Построение дерева каталогов для каждого проекта и копирование файлов лицензии. |
| 3 | [**repo_compose.sh**](repo_compose.sh) | Составление скриптов с параметрами и копирование их в каталоги проектов. |
| | [repo_gitea.tmpl.sh](repo_gitea.tmpl.sh) | Шаблон скрипта без параметров для создания удалённого репозитория gitea. |
| | [repo_gitlab.tmpl.sh](repo_gitlab.tmpl.sh) | Шаблон скрипта без параметров для создания удалённого репозитория gitlab. |
| | [repo_local.tmpl.sh](repo_local.tmpl.sh) | Шаблон скрипта без параметров для создания локального репозитория. |
| 4 | [**repo_update.sh**](repo_update.sh) | Параллельное выполнение скриптов и создание репозиториев для каталогов проектов. |
| № | Скрипты Bash | Выполняемые действия |
|---|:-----------------------------------------------|:---------------------------------------------------------------------------------|
| 1 | [**archive_backup.sh**](archive_backup.sh) | Создание общего архива для каталогов проектов на текущую дату. |
| | [archive_packages.sh](archive_packages.sh) | Сборка вёб-сайтов, создание и копирование архивов для развёртывания. |
| 2 | [**info_param.sh**](info_param.sh) | Параметр для других скриптов. Переключение домена удалённого репозитория. |
| | [info_references.sh](info_references.sh) | Обновление домена удалённого репозитория в перекрёстных ссылках в описаниях. |
| | [info_tree_license.sh](info_tree_license.sh) | Построение дерева каталогов для каждого проекта и копирование файлов лицензии. |
| 3 | [**repo_compose.sh**](repo_compose.sh) | Составление скриптов с параметрами и копирование их в каталоги проектов. |
| | [repo_gitea.tmpl.sh](repo_gitea.tmpl.sh) | Шаблон скрипта без параметров для создания удалённого репозитория gitea. |
| | [repo_gitlab.tmpl.sh](repo_gitlab.tmpl.sh) | Шаблон скрипта без параметров для создания удалённого репозитория gitlab. |
| | [repo_local.tmpl.sh](repo_local.tmpl.sh) | Шаблон скрипта без параметров для создания локального репозитория. |
| 4 | [**repo_orchestrate.sh**](repo_orchestrate.sh) | Параллельное выполнение скриптов и создание репозиториев для каталогов проектов. |
## Каталоги проектов
Локальные каталоги проектов расположены на одном уровне. На сервере
репозитории с вёб-сайтами переходят в отдельную группу, а остальные
репозитории остаются у пользователя. Структура каталогов для
[gitea&period;com](https://gitea&period;com/golovin) и
[git&period;org&period;ru](https://git&period;org&period;ru/golovin) и
[hub&period;mos&period;ru](https://hub&period;mos&period;ru/golovin).
<pre>
@ -35,7 +35,3 @@
├─ <a href='https://hub.mos.ru/pomodoro/5/blob/master/DIRECTORY_TREE.md'>pomodoro5</a>
└─ <a href='https://hub.mos.ru/pomodoro/6/blob/master/DIRECTORY_TREE.md'>pomodoro6</a>
</pre>
---
© Головин Г.Г., Код с комментариями, 2021-2023

View file

@ -1,4 +1,4 @@
#!/bin/bash
#remote="gitea.com"
#remote="git.org.ru"
remote="hub.mos.ru"
echo "Переключение домена удалённого репозитория: $remote"

View file

@ -1,18 +1,18 @@
#!/bin/bash
echo "Обновление домена удалённого репозитория в перекрёстных ссылках в описаниях."
remote="gitea.com" && source info_param.sh
remote="git.org.ru" && source info_param.sh
cd ../.. # выходим из папки и из репозитория
# обходим все репозитории, расположенные на одном уровне с текущим
find . -type f -name 'README*.md' | sort -r | while read -r file; do
echo "$remote => $file"
# заменяем gitea.com => hub.mos.ru => иначе наоборот
# заменяем git.org.ru => hub.mos.ru => иначе наоборот
if [ "$remote" == "hub.mos.ru" ]; then
sed -i 's/gitea\.com/hub\.mos\.ru/g' "$file"
sed -i 's/GITEA/HUB\.MOS\.RU/g' "$file"
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/gitea\.com/g' "$file"
sed -i 's/HUB\.MOS\.RU/GITEA/g' "$file"
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

View file

@ -1,6 +1,6 @@
#!/bin/bash
echo "Составление скриптов с параметрами и копирование их в каталоги проектов."
remote="gitea.com" && source info_param.sh
remote="git.org.ru" && source info_param.sh
basedir=$(pwd)
cd ../.. # выходим из папки и из репозитория
# обходим все репозитории, расположенные на одном уровне с текущим
@ -38,7 +38,7 @@ find . -mindepth 1 -maxdepth 1 -type d | sort -r | while read -r dir; do
elif [[ "$dir" =~ "3" ]]; then
description="Умножение матриц и повороты"
elif [[ "$dir" =~ "4" ]]; then
description="Психология, поэзия и юмор"
description="Философия, поэзия и юмор"
elif [[ "$dir" =~ "5" ]]; then
description="Рисуем картинки текстом"
elif [[ "$dir" =~ "6" ]]; then

View file

@ -4,7 +4,7 @@ fi
if [ -z "$1" ]; then
echo "Создание удалённого репозитория для текущего каталога."
fi
seconds=5
seconds=4
currentTimeMillis=$(date '+%s%3N')
if [ -z "$1" ] || [ "$1" == "delete" ]; then
echo "Удаление старого репозитория."
@ -61,16 +61,17 @@ if [ -z "$1" ] || [ "$1" == "options" ]; then
\"has_pull_requests\": false,
\"has_releases\": false,
\"has_wiki\": $has_wiki }" -i
echo "Добавление аватарки для репозитория."
picture=$repo
if [ "$type" == "org" ]; then
picture="pomodoro-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

View file

@ -4,7 +4,7 @@ fi
if [ -z "$1" ]; then
echo "Создание удалённого репозитория для текущего каталога."
fi
seconds=7
seconds=8
currentTimeMillis=$(date '+%s%3N')
if [ -z "$1" ] || [ "$1" == "delete" ]; then
echo "Удаление старого репозитория."
@ -91,7 +91,7 @@ if [ -z "$1" ] || [ "$1" == "options" ]; then
echo "Добавление аватарки для репозитория."
picture=$repo
if [ "$type" == "org" ]; then
picture="pomodoro-website"
picture="website"
fi
curl -i -X PUT "https://$remote/api/v4/projects/$owner%2F$repo" \
-H "PRIVATE-TOKEN: $token" \

View file

@ -7,8 +7,8 @@
| ![older-tomato-theme](older-tomato-theme.jpg) |
| pomodoro |
| ![pomodoro](pomodoro.jpg) |
| pomodoro-website |
| ![pomodoro-website](pomodoro-website.jpg) |
| website |
| ![website](website.jpg) |
| bash_scripts |
| ![bash_scripts](bash_scripts.jpg) |
| draft |

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB