+9
-9
@@ -3,7 +3,7 @@ type: docker
|
|||||||
name: ci-cd-full
|
name: ci-cd-full
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# ШАГ 1: Сборка и пуш образа в Gitea Registry
|
# Step 1: Build and push image to Gitea Registry
|
||||||
- name: docker-build
|
- name: docker-build
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
pull: always
|
pull: always
|
||||||
@@ -18,7 +18,7 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
|
|
||||||
# ШАГ 2: Деплой на сервер (через SSH)
|
# Step 2: Deploy via SSH
|
||||||
- name: ssh-deploy
|
- name: ssh-deploy
|
||||||
image: appleboy/drone-ssh:1.7
|
image: appleboy/drone-ssh:1.7
|
||||||
pull: always
|
pull: always
|
||||||
@@ -32,23 +32,23 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: deploy_password
|
from_secret: deploy_password
|
||||||
script_stop: true
|
script_stop: true
|
||||||
# Важно: script здесь — это команды, которые выполнятся НА СЕРВЕРЕ, а не в контейнере
|
# The pipe '|' ensures the whole block is sent as a script to the server
|
||||||
script: |
|
script: |
|
||||||
# 1. Создаем структуру папок в домашней директории пользователя
|
# 1. Create directory structure in home folder (no permission issues here)
|
||||||
mkdir -p ~/na-granicelife/assets/mp4
|
mkdir -p ~/na-granicelife/assets/mp4
|
||||||
|
|
||||||
# 2. Клонируем код во временную папку на сервере
|
# 2. Clone code to temp folder on the server
|
||||||
rm -rf /tmp/na-granice-deploy
|
rm -rf /tmp/na-granice-deploy
|
||||||
git clone --depth 1 --branch main https://gitea.allowlgroup.ru/na-granicelife.ru/front.git /tmp/na-granice-deploy
|
git clone --depth 1 --branch main https://gitea.allowlgroup.ru/na-granicelife.ru/front.git /tmp/na-granice-deploy
|
||||||
|
|
||||||
# 3. Копируем файлы, КРОМЕ папки с видео
|
# 3. Copy all files EXCEPT the mp4 folder
|
||||||
# find ищет файлы, -not исключает mp4, cp копирует их в целевую папку
|
# find locates files, -not excludes the mp4 path, cp copies them
|
||||||
find /tmp/na-granice-deploy -type f -not -path '*assets/mp4*' -exec cp --no-preserve=mode {} ~/na-granicelife \;
|
find /tmp/na-granice-deploy -type f -not -path '*assets/mp4*' -exec cp --no-preserve=mode {} ~/na-granicelife \;
|
||||||
|
|
||||||
# 4. Чистим временную папку
|
# 4. Clean up temp folder
|
||||||
rm -rf /tmp/na-granice-deploy
|
rm -rf /tmp/na-granice-deploy
|
||||||
|
|
||||||
# 5. ВАЖНО: Все команды Docker выполняются НА СЕРВЕРЕ напрямую
|
# 5. Run docker compose commands directly on the server
|
||||||
cd ~/na-granicelife
|
cd ~/na-granicelife
|
||||||
docker compose pull web
|
docker compose pull web
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|||||||
Reference in New Issue
Block a user