added deploy script (WIP)

parent 6cd32e1a
......@@ -55,7 +55,6 @@ print_build_info() {
check () {
if [ "$MD5" == "true" ] && [ "$DEPLOY_DIR" != "ftp" ]; then
print_error "--md5 можно использовать только при --deploy=ftp"
exit 1
fi
}
......@@ -131,7 +130,7 @@ makebuild() {
make DISTRO_VERSION="$VER" APTCONF="$APTCONF" "ximper-${desktop_env}${iso_suffix}.iso"
# Генерация имени файла
DFILENAME="ximper-${desktop_env}${iso_suffix}-${VER}-$(date +"%Y_%m_%d_%H%M")"
DFILENAME="ximper-${desktop_env}${iso_suffix}-${VER}-$(date +"%Y_%m_%d_%H_%M")"
# Добавление хэша коммита или примечания о временном коммите
if [ "$VER" == "devel" ]; then
......@@ -174,7 +173,6 @@ deploy() {
OPTS=$(getopt -o h --long help,nvidia,debug,clean,all,deploy::,md5,gnome,hyprland,net,network,repos: -- "$@") || {
print_error "Ошибка обработки опций."
exit 1
}
# Применение параметров
......@@ -276,7 +274,6 @@ while true; do
continue
fi
print_error "Неверная опция: $1"
exit 1
;;
esac
done
......@@ -301,7 +298,6 @@ if [ -n "$1" ]; then
shift
else
print_error "Не указана версия дистрибутива."
exit 1
fi
check
......
......@@ -2,6 +2,7 @@
print_error() {
printf "\033[1;31m%s\033[0m\n" "$1"
exit 1
}
print_green() {
......
#!/bin/bash
BUILDERDIR=$(realpath "$(dirname "$0")"/..)
SOURCE_DIR="/var/ftp/pvt/ISO/testing/template/iso"
IS_DEVEL=false
# базовые функции
# shellcheck disable=SC1091
. "$BUILDERDIR"/bin/common
if [[ "$1" == "--devel" ]]; then
IS_DEVEL=true
VERSION="devel"
shift
elif [ -z "$1" ]; then
print_error "Не указана версия образов. Использование: ./deploy.sh <версия> [--devel]"
else
VERSION="$1"
shift
fi
if $IS_DEVEL; then
TARGET_DIR="/var/ftp/pub/Etersoft/XimperLinux/Devel/ISO"
else
TARGET_DIR="/var/ftp/pub/Etersoft/XimperLinux/Current/ISO"
fi
copied_files=()
for iso_file in "$SOURCE_DIR"/ximper-*"$VERSION"*-*.iso; do
if [ ! -f "$iso_file" ]; then
continue
fi
new_filename=$(basename "$iso_file")
if ! $IS_DEVEL; then
# Для Current версии убираем часть .rc{rc-ver}-{date}
new_filename=$(echo "$new_filename" | sed -E 's/\.rc[0-9]+-[0-9_]+//')
fi
target_file="$TARGET_DIR/$new_filename"
echo "$iso_file"
echo "$target_file"
#cp "$iso_file" "$target_file" || print_error "Не удалось скопировать файл: $iso_file -> $target_file"
copied_files+=("$target_file")
done
if [ ${#copied_files[@]} -eq 0 ]; then
print_error "Не найдено ни одного образа для версии $VERSION"
fi
exit 0
for file in "${copied_files[@]}"; do
"$BUILDERDIR"/bin/gen_md5 "$file"
done
if ! $IS_DEVEL; then
pushd "$TARGET_DIR" > /dev/null || exit
"$BUILDERDIR"/bin/torrents_create "${copied_files[@]}" || print_error "Ошибка при создании торрентов"
"$BUILDERDIR"/bin/torrents_deploy
popd > /dev/null || exit
fi
print_green "Деплой успешно завершён!"
......@@ -8,7 +8,6 @@ NETWORK=false
OPTS=$(getopt -o h,d:,r: --long help,net,network,dir:,repos: -- "$@") || {
print_error "Ошибка обработки опций."
exit 1
}
# Применение параметров
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment