gonets/.woodpecker/.woodpecker.yml
s.galanskiy a408287d99
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Обновить .woodpecker/.woodpecker.yml
2025-06-30 14:56:08 +05:00

107 lines
No EOL
4.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

when:
event: [push, tag]
branch: main
steps:
checkout:
image: debian:latest
environment:
GONETS:
from_secret: GONETS
commands:
- pwd
- echo $SHELL
- rm -rf gonets
# ПОДГОТОВКА ГИТА И КЛОНИРОВАНИЕ GONETS
- apt update
- apt install -y git git-lfs
- git lfs install
# УСТАНОВКА НЕОБХОДИМЫХ ЗАВИСИМОСТЕЙ НА СИСТЕМЕ
- apt update
- apt install -y python3 tree 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
# ПОДГОТОВКА СПИСКА PYTHON ЗАВИСИМОСТЕЙ GONETS
- 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 SRV
- poetry env activate
- poetry add poetry-plugin-export
- poetry install
- poetry self update
- rm -f requirements.txt
- poetry run poetry export -f requirements.txt --output requirements.txt --without-hashes
# ПОДГОТОВКА И СБОРКА FRONTEND ЧАСТИ GONETS
- pwd
- cd ..
- pwd
- cd FRONT/DEV
- pwd
- npm install
- npm run package
- cd dist/gonets-linux-x64/resources/app
- pwd
- 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 ../../../../..
- pwd
- rm -rf BUILD/*
- cp -r DEV/dist/gonets-linux-x64/* BUILD/
- rm -rf DEV
# ИНИЦИАЛИЗАЦИЯ DEBIAN КОНФИГУРАЦИЙ ДЛЯ СБОРКИ
- cd ..
- pwd
- cd ..
- pwd
- mv gonets gonets-0.1
- cd gonets-0.1
- pwd
- ls
- DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y --createorig
- cd debian/
- rm -f *.ex
- rm -f README.*
# КЛОНИРОВАНИЕ НЕОБХОДИМЫХ ШАБЛОНОВ КОНФИГОВ ДЕБИАНА ДЛЯ СБОРКИ
- mkdir -p /woodpecker/src/dev.gossys.dev/s.galanskiy/templates
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git /woodpecker/src/dev.gossys.dev/s.galanskiy/templates
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/changelog /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/control /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/copyright /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/install /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/postinst /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/postrm /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/rules /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
# СБОРКА ДЕБИАН ПАКЕТА
- cd ..
- pwd
- dpkg-buildpackage -us -uc -b
# ИЗВЛЕЧЕНИЕ ВЕРСИИ ПАКЕТА ДЛЯ КОММИТА
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version)
- echo "VERSION=$VERSION" > version.env
# КОММИТ И ТЕГ НА ВЕТКУ DEVELOP
- 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"