gonets/.woodpecker/.woodpecker.yml

102 lines
3.8 KiB
YAML
Raw Normal View History

when:
event: [push, tag]
branch: main
steps:
checkout:
image: debian:latest
environment:
GONETS:
from_secret: GONETS
commands:
2025-06-30 13:16:33 +05:00
- echo $SHELL
- rm -rf gonets
# ПОДГОТОВКА ГИТА И КЛОНИРОВАНИЕ GONETS
- apt update
- apt install -y git git-lfs
- git lfs install
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets.git -b main
# УСТАНОВКА НЕОБХОДИМЫХ ЗАВИСИМОСТЕЙ НА СИСТЕМЕ
- apt update
2025-06-30 13:16:33 +05:00
- apt install -y python3 python3.11-venv python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev cmake libgirepository1.0-dev gobject-introspection libcairo2-dev pkg-config python3-dev libdbus-1-dev
- python3 --version
- node -v
- npm -v
2025-06-27 12:34:51 +05:00
# ПОДГОТОВКА СПИСКА PYTHON ЗАВИСИМОСТЕЙ GONETS
2025-06-30 13:16:33 +05:00
- rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
- rm -rf /root/.local/share/pypoetry
- rm -rf /root/.poetry
- rm -rf /usr/bin/poetry
- pip install pipx
- pipx ensurepath
- pipx install poetry
- echo 'export PATH="$HOME/.local/bin:$PATH"' >> /root/.bashrc
- . /root/.bashrc
- poetry --version
- cd gonets/SRV
2025-06-30 13:16:33 +05:00
- poetry env activate
- poetry add poetry-plugin-export
- poetry install
2025-06-30 13:16:33 +05:00
- poetry self update
- rm -f requirements.txt
2025-06-30 13:16:33 +05:00
- poetry run poetry export -f requirements.txt --output requirements.txt --without-hashes
- pwd
# ПОДГОТОВКА И СБОРКА FRONTEND ЧАСТИ GONETS
- cd /
- pwd
- cd gonets/FRONT/DEV
- npm install
- npm run package
- cd dist/gonets-linux-x64/resources/app
- npm run build
- sed -i 's/href="\/assets\//href=".\/assets\//g' dist/index.html
- sed -i 's/src="\/assets\//src=".\/assets\//g' dist/index.html
- cd ../../../..
- rm -rf FRONT/BUILD/*
- cp -r dist/gonets-linux-x64/* ../../BUILD/
- cd ../..
- rm -rf DEV
2025-06-27 12:34:51 +05:00
# ИНИЦИАЛИЗАЦИЯ DEBIAN КОНФИГУРАЦИЙ ДЛЯ СБОРКИ
- cd /
- cd gonets
- DESKTOP=1 DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y
- cd debian/
- rm -f *.ex
- rm -f README.*
2025-06-27 12:34:51 +05:00
# КЛОНИРОВАНИЕ НЕОБХОДИМЫХ ШАБЛОНОВ КОНФИГОВ ДЕБИАНА ДЛЯ СБОРКИ
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git
- mv gonets-debian-template/changelog gonets/debian/
- mv gonets-debian-template/control gonets/debian/
- mv gonets-debian-template/copyright gonets/debian/
- mv gonets-debian-template/install gonets/debian/
- mv gonets-debian-template/postinst gonets/debian/
- mv gonets-debian-template/postrm gonets/debian/
- mv gonets-debian-template/rules gonets/debian/
2025-06-27 12:34:51 +05:00
# СБОРКА ДЕБИАН ПАКЕТА
- cd /
- cd gonets
- dpkg-buildpackage -us -uc -b
2025-06-27 12:34:51 +05:00
# ИЗВЛЕЧЕНИЕ ВЕРСИИ ПАКЕТА ДЛЯ КОММИТА
- cd /
- cd gonets
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version)
- echo "VERSION=$VERSION" > version.env
2025-06-27 12:34:51 +05:00
# КОММИТ И ТЕГ НА ВЕТКУ DEVELOP
- cd /
- cd gonets
- source version.env
- git config user.name "s.galanskiy"
- git config user.email "s.galanskiy@gossys.dev"
- git checkout develop
- git commit -am "Релиз $VERSION"
- git tag "v$VERSION"
- git push https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets.git develop
- git push https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets.git "v$VERSION"