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

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

View file

@ -1,92 +1,82 @@
when: environment:
event: [push, tag] GONETS: your_token_here
branch: main 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: pipeline:
checkout: image: debian:latest
image: debian:latest steps:
environment: - name: Checkout
GONETS: commands:
from_secret: GONETS - git clone --depth 0 --branch main . .
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
install_deps: - name: Install dependencies
commands: commands:
- apt update - apt update
- apt install -y python3 #python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev - apt install -y python3 python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev
- python3 --version
prepare_python_deps: - name: Prepare python dependencies
commands: commands:
- cd gonets/SRV - cd SRV
- curl -sSL https://install.python-poetry.org | python3 - - rm -f requirements.txt
- rm -f requirements.txt - poetry export -f requirements.txt --output requirements.txt --without-hashes
- poetry export -f requirements.txt --output requirements.txt --without-hashes
build_backend: - name: Build backend
commands: commands:
- cd gonets/SRV - cd SRV
- poetry install - poetry install
build_frontend: - name: Build frontend
commands: commands:
- cd FRONT/DEV - cd FRONT/DEV
- npm install - npm install
- npm run package - npm run package
- cd dist/gonets-linux-x64/resources/app - cd dist/gonets-linux-x64/resources/app
- npm run build - npm run build
- sed -i 's/href="\/assets\//href=".\/assets\//g' dist/index.html - sed -i 's/href="\/assets\//href=".\/assets\//g' dist/index.html
- sed -i 's/src="\/assets\//src=".\/assets\//g' dist/index.html - sed -i 's/src="\/assets\//src=".\/assets\//g' dist/index.html
- cd ../../../.. - cd ../../../..
- rm -rf FRONT/BUILD/* - rm -rf FRONT/BUILD/*
- cp -r dist/gonets-linux-x64/* ../../BUILD/ - cp -r dist/gonets-linux-x64/* ../../BUILD/
- cd ../.. - cd ../..
- rm -rf DEV - rm -rf DEV
prepare_debian: - name: Prepare debian package
commands: commands:
- DESKTOP=1 DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y - DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig
- cd debian/ - cd debian/
- rm -f *.ex - rm -f *.ex
- rm -f README.* - rm -f README.*
clone_debian_config: - name: Clone debian configuration
environment: commands:
GONETS: - git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git
from_secret: GONETS - mv gonets-debian-template/changelog gonets/debian/
commands: - mv gonets-debian-template/control gonets/debian/
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git - mv gonets-debian-template/copyright gonets/debian/
- mv gonets-debian-template/changelog gonets/debian/ - mv gonets-debian-template/install gonets/debian/
- mv gonets-debian-template/control gonets/debian/ - mv gonets-debian-template/postinst gonets/debian/
- mv gonets-debian-template/copyright gonets/debian/ - mv gonets-debian-template/postrm gonets/debian/
- mv gonets-debian-template/install gonets/debian/ - mv gonets-debian-template/rules 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: - name: Build package
commands: commands:
- dpkg-buildpackage -us -uc -b - dpkg-buildpackage -us -uc -b
get_version: - name: Get version from changelog
commands: commands:
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version) - VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field VERSION)
- echo "VERSION=$VERSION" > version.env - echo "VERSION=$VERSION" > version.env
commit_changes: - name: Commit changes to develop
environment: commands:
GONETS: - source version.env
from_secret: GONETS - git config user.name "$GIT_AUTHOR_NAME"
commands: - git config user.email "$GIT_AUTHOR_EMAIL"
- source version.env - git checkout develop
- git config user.name "s.galanskiy" - git commit -am "Релиз $VERSION"
- git config user.email "s.galanskiy@gossys.dev" - git tag "v$VERSION"
- git checkout develop - git push origin develop
- git commit -am "Релиз $VERSION" - git push origin "v$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"