From 448102dbeb97c585c176da173cb04c763b0798e9 Mon Sep 17 00:00:00 2001 From: "s.galanskiy" Date: Fri, 27 Jun 2025 14:54:54 +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 | 154 +++++++++++++++++------------------- 1 file changed, 72 insertions(+), 82 deletions(-) diff --git a/.woodpecker/.woodpecker.yml b/.woodpecker/.woodpecker.yml index c0bc036..c047b51 100644 --- a/.woodpecker/.woodpecker.yml +++ b/.woodpecker/.woodpecker.yml @@ -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" \ No newline at end of file + - 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"