Skip to content

Commit

Permalink
restructure dirs and files, added script for autocreating files
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav Alenchyk committed Jan 4, 2025
1 parent bd78445 commit d647fe7
Show file tree
Hide file tree
Showing 57 changed files with 21 additions and 19 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# DevOps Trainee Tasks

епозиторий с заданиями для стажей DevOps-инженеров. :)
Репозиторий с заданиями для стажей DevOps-инженеров. :)
## Linux

[Task 1.1](Task_1.1/description_Task_1_1.md) [Task 1.2](Task_1.2/description_Task_1_2.md) [Task 1.3](Task_1.3/description_Task_1_3.md) [Task 1.4](Task_1.4/description_Task_1_4.md) [Task 1.5](Task_1.5/description_Task_1_5.md) [Task 1.6](Task_1.6/description_Task_1_6.md)
[Task 1.1](Tasks/Task_1.1/description_Task_1_1.md) [Task 1.2](Tasks/Task_1.2/description_Task_1_2.md) [Task 1.3](Tasks/Task_1.3/description_Task_1_3.md) [Task 1.4](Tasks/Task_1.4/description_Task_1_4.md) [Task 1.5](Tasks/Task_1.5/description_Task_1_5.md) [Task 1.6](Tasks/Task_1.6/description_Task_1_6.md)

## Git

[Task 2.1](Task_2.1/description_Task_2_1.md) [Task 2.2](Task_2.2/description_Task_2_2.md) [Task 2.3](Task_2.3/description_Task_2_3.md) [Task 2.4](Task_2.4/description_Task_2_4.md) [Task 2.5](Task_2.5/description_Task_2_5.md) [Task 2.6](Task_2.6/description_Task_2_6.md) [Task 2.7](Task_2.7/description_Task_2_7.md)
[Task 2.1](Tasks/Task_2.1/description_Task_2_1.md) [Task 2.2](Tasks/Task_2.2/description_Task_2_2.md) [Task 2.3](Tasks/Task_2.3/description_Task_2_3.md) [Task 2.4](Tasks/Task_2.4/description_Task_2_4.md) [Task 2.5](Tasks/Task_2.5/description_Task_2_5.md) [Task 2.6](Tasks/Task_2.6/description_Task_2_6.md) [Task 2.7](Tasks/Task_2.7/description_Task_2_7.md)

## Docker

[Task 3.11](Task_3.11/description_Task_3_11.md) [Task 3.12](Task_3.12/description_Task_3_12.md) [Task 3.13](Task_3.13/description_Task_3_13.md) [Task 3.14](Task_3.14/description_Task_3_14.md) [Task 3.15](Task_3.15/description_Task_3_15.md) [Task 3.16](Task_3.16/description_Task_3_16.md) [Task 3.17](Task_3.17/description_Task_3_17.md) [Task 3.18](Task_3.18/description_Task_3_18.md) [Task 3.19](Task_3.19/description_Task_3_19.md) [Task 3.20](Task_3.20/description_Task_3_20.md) [Task 3.21](Task_3.21/description_Task_3_21.md) [Task 3.22](Task_3.22/description_Task_3_22.md) [Task 3.23](Task_3.23/description_Task_3_23.md) [Task 3.24](Task_3.24/description_Task_3_24.md) [Task 3.25](Task_3.25/description_Task_3_25.md) [Task 3.26](Task_3.26/description_Task_3_26.md) [Task 3.27](Task_3.27/description_Task_3_27.md) [Task 3.28](Task_3.28/description_Task_3_28.md) [Task 3.29](Task_3.29/description_Task_3_29.md) [Task 3.30](Task_3.30/description_Task_3_30.md) [Task 3.31](Task_3.31/description_Task_3_31.md) [Task 3.32](Task_3.32/description_Task_3_32.md) [Task 3.33](Task_3.33/description_Task_3_33.md) [Task 3.34](Task_3.34/description_Task_3_34.md) [Task 3.35](Task_3.35/description_Task_3_35.md) [Task 3.36](Task_3.36/description_Task_3_36.md) [Task 3.37](Task_3.37/description_Task_3_37.md) [Task 3.38](Task_3.38/description_Task_3_38.md) [Task 3.39](Task_3.39/description_Task_3_39.md) [Task 3.40](Task_3.40/description_Task_3_40.md) [Task 3.41](Task_3.41/description_Task_3_41.md)
[Task 3.11](Tasks/Task_3.11/description_Task_3_11.md) [Task 3.12](Tasks/Task_3.12/description_Task_3_12.md) [Task 3.13](Tasks/Task_3.13/description_Task_3_13.md) [Task 3.14](Tasks/Task_3.14/description_Task_3_14.md) [Task 3.15](Tasks/Task_3.15/description_Task_3_15.md) [Task 3.16](Tasks/Task_3.16/description_Task_3_16.md) [Task 3.17](Tasks/Task_3.17/description_Task_3_17.md) [Task 3.18](Tasks/Task_3.18/description_Task_3_18.md) [Task 3.19](Tasks/Task_3.19/description_Task_3_19.md) [Task 3.20](Tasks/Task_3.20/description_Task_3_20.md) [Task 3.21](Tasks/Task_3.21/description_Task_3_21.md) [Task 3.22](Tasks/Task_3.22/description_Task_3_22.md) [Task 3.23](Tasks/Task_3.23/description_Task_3_23.md) [Task 3.24](Tasks/Task_3.24/description_Task_3_24.md) [Task 3.25](Tasks/Task_3.25/description_Task_3_25.md) [Task 3.26](Tasks/Task_3.26/description_Task_3_26.md) [Task 3.27](Tasks/Task_3.27/description_Task_3_27.md) [Task 3.28](Tasks/Task_3.28/description_Task_3_28.md) [Task 3.29](Tasks/Task_3.29/description_Task_3_29.md) [Task 3.30](Tasks/Task_3.30/description_Task_3_30.md) [Task 3.31](Tasks/Task_3.31/description_Task_3_31.md) [Task 3.32](Tasks/Task_3.32/description_Task_3_32.md) [Task 3.33](Tasks/Task_3.33/description_Task_3_33.md) [Task 3.34](Tasks/Task_3.34/description_Task_3_34.md) [Task 3.35](Tasks/Task_3.35/description_Task_3_35.md) [Task 3.36](Tasks/Task_3.36/description_Task_3_36.md) [Task 3.37](Tasks/Task_3.37/description_Task_3_37.md) [Task 3.38](Tasks/Task_3.38/description_Task_3_38.md) [Task 3.39](Tasks/Task_3.39/description_Task_3_39.md) [Task 3.40](Tasks/Task_3.40/description_Task_3_40.md) [Task 3.41](Tasks/Task_3.41/description_Task_3_41.md)

## CI/CD

[Task 4.11](Task_4.11/description_Task_4_11.md) [Task 4.12](Task_4.12/description_Task_4_12.md) [Task 4.13](Task_4.13/description_Task_4_13.md)
[Task 4.11](Tasks/Task_4.11/description_Task_4_11.md) [Task 4.12](Tasks/Task_4.12/description_Task_4_12.md) [Task 4.13](Tasks/Task_4.13/description_Task_4_13.md)

## Ansible

[Task 5.1](Task_5.1/description_Task_5_1.md) [Task 5.2](Task_5.2/description_Task_5_2.md) [Task 5.3](Task_5.3/description_Task_5_3.md) [Task 5.4](Task_5.4/description_Task_5_4.md)
[Task 5.1](Tasks/Task_5.1/description_Task_5_1.md) [Task 5.2](Tasks/Task_5.2/description_Task_5_2.md) [Task 5.3](Tasks/Task_5.3/description_Task_5_3.md) [Task 5.4](Tasks/Task_5.4/description_Task_5_4.md)

## Terraform

[Task 6.11](Task_6.11/description_Task_6_11.md) [Task 6.12](Task_6.12/description_Task_6_12.md) [Task 6.13](Task_6.13/description_Task_6_13.md) [Task 6.14](Task_6.14/description_Task_6_14.md) [Task 6.15](Task_6.15/description_Task_6_15.md) [Task 6.16](Task_6.16/description_Task_6_16.md) [Task 6.17](Task_6.17/description_Task_6_17.md) [Task 6.18](Task_6.18/description_Task_6_18.md) [Task 6.19](Task_6.19/description_Task_6_19.md) [Task 6.20](Task_6.20/description_Task_6_20.md) [Task 6.21](Task_6.21/description_Task_6_21.md) [Task 6.22](Task_6.22/description_Task_6_22.md)
[Task 6.11](Tasks/Task_6.11/description_Task_6_11.md) [Task 6.12](Tasks/Task_6.12/description_Task_6_12.md) [Task 6.13](Tasks/Task_6.13/description_Task_6_13.md) [Task 6.14](Tasks/Task_6.14/description_Task_6_14.md) [Task 6.15](Tasks/Task_6.15/description_Task_6_15.md) [Task 6.16](Tasks/Task_6.16/description_Task_6_16.md) [Task 6.17](Tasks/Task_6.17/description_Task_6_17.md) [Task 6.18](Tasks/Task_6.18/description_Task_6_18.md) [Task 6.19](Tasks/Task_6.19/description_Task_6_19.md) [Task 6.20](Tasks/Task_6.20/description_Task_6_20.md) [Task 6.21](Tasks/Task_6.21/description_Task_6_21.md) [Task 6.22](Tasks/Task_6.22/description_Task_6_22.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
26 changes: 14 additions & 12 deletions create_dirs_and_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,46 @@

# Функция помощи
function show_help() {
echo -e "\nИспользование: $0 <prefix> <start> <end>"
echo -e "\nИспользование: $0 <parent_prefix> <child_prefix> <start> <end>"
echo
echo "Создает директории с именами, основанными на префиксе, и файлы внутри этих директорий."
echo "Директории будут иметь формат <prefix>.<номер>, а файлы будут называться description_<prefix>_<номер>.md."
echo
echo "Параметры:"
echo " <prefix> Префикс для названия директории (например, Task_1)"
echo " <parent_prefix> Префикс для названия директории (например, Tasks)"
echo " <child_prefix> Префикс для названия директории (например, Task_1)"
echo " <start> Начальный номер диапазона (например, 1)"
echo " <end> Конечный номер диапазона (например, 10)"
echo
echo "Пример:"
echo " $0 Task_1 1 10"
echo " $0 Tasks Task_1 1 10"
echo " Этот пример создаст директории Task_1.1, Task_1.2, ..., Task_1.10 и файлы внутри них."
echo
exit 1
}

# Проверка на количество аргументов
if [ $# -ne 3 ]; then
if [ $# -ne 4 ]; then
show_help
fi

prefix=$1 # Префикс для директорий (например, Task_1)
start=$2 # Начало диапазона
end=$3 # Конец диапазона
parent_prefix=$1 # Префикс для родительской директории(например, Tasks)
child_prefix=$2 # Префикс для директорий (например, Task_1)
start=$3 # Начало диапазона
end=$4 # Конец диапазона

# Процесс создания директорий и файлов
for i in $(seq $start $end); do
task_dir="${prefix}.${i}"
file_name="description_${prefix}_${i}.md"
child_dir="${parent_prefix}/${child_prefix}.${i}"
file_name="description_${child_prefix}_${i}.md"

# Создаем директорию
mkdir -p "$task_dir"
mkdir -p "$child_dir"

# Создаем файл в этой директории
touch "$task_dir/$file_name"
touch "$child_dir/$file_name"

echo "Создано: $task_dir/$file_name"
echo "Создано: $child_dir/$file_name"
done

echo "Все директории и файлы успешно созданы!"

0 comments on commit d647fe7

Please sign in to comment.