ci-cd-8
This commit is contained in:
parent
91a3331003
commit
fa737495a6
2 changed files with 105 additions and 15 deletions
|
|
@ -1,15 +0,0 @@
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
branch: main
|
|
||||||
|
|
||||||
steps:
|
|
||||||
build:
|
|
||||||
image: debian
|
|
||||||
commands:
|
|
||||||
- echo "This is the build step"
|
|
||||||
- echo "binary-data-123" > executable
|
|
||||||
a-test-step:
|
|
||||||
image: golang:1.16
|
|
||||||
commands:
|
|
||||||
- echo "Testing ..."
|
|
||||||
- ./executable
|
|
||||||
105
.woodpecker/.woodpecker.yml
Normal file
105
.woodpecker/.woodpecker.yml
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
when:
|
||||||
|
event: [push, tag]
|
||||||
|
branch: main
|
||||||
|
|
||||||
|
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 init
|
||||||
|
- git remote add origin https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets.git
|
||||||
|
- git fetch --no-tags --depth=1 --filter=tree:0 origin main
|
||||||
|
- git checkout main
|
||||||
|
- git lfs fetch
|
||||||
|
- git lfs checkout
|
||||||
|
- git submodule update --init --recursive --depth=1 --recommend-shallow
|
||||||
|
|
||||||
|
install_deps:
|
||||||
|
image: debian:latest
|
||||||
|
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:
|
||||||
|
image: debian:latest
|
||||||
|
commands:
|
||||||
|
- cd SRV
|
||||||
|
- rm -f requirements.txt
|
||||||
|
- poetry export -f requirements.txt --output requirements.txt --without-hashes
|
||||||
|
|
||||||
|
build_backend:
|
||||||
|
image: debian:latest
|
||||||
|
commands:
|
||||||
|
- cd SRV
|
||||||
|
- poetry install
|
||||||
|
|
||||||
|
build_frontend:
|
||||||
|
image: debian:latest
|
||||||
|
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:
|
||||||
|
image: debian:latest
|
||||||
|
commands:
|
||||||
|
- DESKTOP=1 DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y
|
||||||
|
- cd debian/
|
||||||
|
- rm -f *.ex
|
||||||
|
- rm -f README.*
|
||||||
|
|
||||||
|
clone_debian_config:
|
||||||
|
image: debian:latest
|
||||||
|
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/
|
||||||
|
|
||||||
|
build_package:
|
||||||
|
image: debian:latest
|
||||||
|
commands:
|
||||||
|
- dpkg-buildpackage -us -uc -b
|
||||||
|
|
||||||
|
get_version:
|
||||||
|
image: debian:latest
|
||||||
|
commands:
|
||||||
|
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version)
|
||||||
|
- echo "VERSION=$VERSION" > version.env
|
||||||
|
|
||||||
|
commit_changes:
|
||||||
|
image: debian:latest
|
||||||
|
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"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue