From c1cf4f33f583b29a7c08ef422dbf961136fdc6d5 Mon Sep 17 00:00:00 2001 From: "s.galanskiy" Date: Fri, 27 Jun 2025 14:55:47 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.woodpecker/.woodpecker.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.woodpecker.yml | 144 ++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/.woodpecker/.woodpecker.yml b/.woodpecker/.woodpecker.yml index c047b51..b1649cb 100644 --- a/.woodpecker/.woodpecker.yml +++ b/.woodpecker/.woodpecker.yml @@ -1,82 +1,78 @@ -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_and_install: + image: debian:latest + commands: + - 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 -pipeline: - image: debian:latest - steps: - - name: Checkout - commands: - - git clone --depth 0 --branch main . . + prepare_python_deps: + commands: + - cd SRV + - rm -f requirements.txt + - poetry export -f requirements.txt --output requirements.txt --without-hashes - - 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 + build_backend: + commands: + - cd SRV + - poetry install - - name: Prepare python dependencies - commands: - - cd SRV - - rm -f requirements.txt - - poetry export -f requirements.txt --output requirements.txt --without-hashes + 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 backend - commands: - - cd SRV - - poetry install + prepare_debian: + commands: + - DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig + - cd debian/ + - rm -f *.ex + - rm -f README.* - - 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 + clone_debian_config: + environment: + GONETS: your_token_here + 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: Prepare debian package - commands: - - DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig - - cd debian/ - - rm -f *.ex - - rm -f README.* + build_package: + commands: + - dpkg-buildpackage -us -uc -b - - 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/ + get_version: + commands: + - VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field VERSION) + - echo "VERSION=$VERSION" > version.env - - name: Build package - commands: - - dpkg-buildpackage -us -uc -b - - - name: Get version from changelog - commands: - - VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field VERSION) - - echo "VERSION=$VERSION" > version.env - - - 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" + commit_changes: + environment: + 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: + - 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"