gonets/.woodpecker/.woodpecker.yml
s.galanskiy e64b5eeac4
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Обновить .woodpecker/.woodpecker.yml
2025-06-27 15:01:56 +05:00

69 lines
2.5 KiB
YAML

steps:
all_in_one:
image: debian:latest
environment:
GONETS: your_token_here
GIT_AUTHOR_NAME: s.galanskiy
GIT_AUTHOR_EMAIL: s.galanskiy@gossys.dev
GIT_COMMITTER_NAME: s.galanskiy
GIT_COMMITTER_EMAIL: s.galanskiy@gossys.dev
commands:
- echo '=== Checkout and install dependencies ==='
- git clone --depth 0 --branch main . .
- apt update
- apt install -y python3 python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev
- echo '=== Prepare python dependencies ==='
- cd SRV
- rm -f requirements.txt
- poetry export -f requirements.txt --output requirements.txt --without-hashes
- poetry install
- cd ..
- echo '=== Build frontend ==='
- cd 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
- echo '=== Prepare debian package ==='
- DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig
- cd debian/
- rm -f *.ex
- rm -f README.*
- cd ..
- echo '=== Clone debian configuration ==='
- 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/
- echo '=== Build package ==='
- dpkg-buildpackage -us -uc -b
- echo '=== Get version from changelog ==='
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field VERSION)
- echo "VERSION=$VERSION" > version.env
- echo '=== Commit changes to develop ==='
- source version.env
- git config user.name "$GIT_AUTHOR_NAME"
- git config user.email "$GIT_AUTHOR_EMAIL"
- git checkout develop
- git commit -am "Релиз $VERSION"
- git tag "v$VERSION"
- git push origin develop
- git push origin "v$VERSION"