Обновить .woodpecker/.woodpecker.yml

This commit is contained in:
parent 5e2a10f211
commit 448102dbeb

View file

@ -1,92 +1,82 @@
when:
event: [push, tag]
branch: main
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
steps:
checkout:
image: debian:latest
environment:
GONETS:
from_secret: GONETS
commands:
- apt-get update
- apt-get install -y git git-lfs
- git lfs install
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets.git
pipeline:
image: debian:latest
steps:
- name: Checkout
commands:
- git clone --depth 0 --branch main . .
install_deps:
commands:
- apt update
- apt install -y python3 #python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev
- python3 --version
- name: Install dependencies
commands:
- apt update
- apt install -y python3 python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev
prepare_python_deps:
commands:
- cd gonets/SRV
- curl -sSL https://install.python-poetry.org | python3 -
- rm -f requirements.txt
- poetry export -f requirements.txt --output requirements.txt --without-hashes
- name: Prepare python dependencies
commands:
- cd SRV
- rm -f requirements.txt
- poetry export -f requirements.txt --output requirements.txt --without-hashes
build_backend:
commands:
- cd gonets/SRV
- poetry install
- name: Build backend
commands:
- cd SRV
- poetry install
build_frontend:
commands:
- 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
- name: Build frontend
commands:
- 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
prepare_debian:
commands:
- DESKTOP=1 DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y
- cd debian/
- rm -f *.ex
- rm -f README.*
- name: Prepare debian package
commands:
- DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig
- cd debian/
- rm -f *.ex
- rm -f README.*
clone_debian_config:
environment:
GONETS:
from_secret: GONETS
commands:
- 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/
- name: Clone debian configuration
commands:
- 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/
build_package:
commands:
- dpkg-buildpackage -us -uc -b
- name: Build package
commands:
- dpkg-buildpackage -us -uc -b
get_version:
commands:
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version)
- echo "VERSION=$VERSION" > version.env
- name: Get version from changelog
commands:
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field VERSION)
- echo "VERSION=$VERSION" > version.env
commit_changes:
environment:
GONETS:
from_secret: GONETS
commands:
- 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"
- name: Commit changes to develop
commands:
- 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"