[#323] Added logic to create deb package

This commit is contained in:
Fabio Manganiello 2023-09-18 11:00:46 +02:00
parent 07c88c9530
commit 2c74868315
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -179,7 +179,7 @@ steps:
- git config --global --add safe.directory $PWD
- git pull --rebase origin master --tags
- export VERSION=$(python setup.py --version)
- export HEAD=$(git log | head -1 | awk '{printf "%.8s", $2}')
- export HEAD=$(git log --pretty=format:%h HEAD...HEAD~1)
- export GIT_VERSION="$VERSION.r$(git log --pretty=oneline HEAD...v$VERSION | wc -l).$HEAD"
- export TAG_URL="https://git.platypush.tech/platypush/platypush/archive/v$VERSION.tar.gz"
- export TAG_ARCHIVE="platypush-$VERSION.tar.gz"
@ -244,6 +244,56 @@ steps:
git push origin master
fi
- name: update-debian-packages
image: python:3.11-bookworm
environment:
WORKDIR: /tmp/workdir
STABLE_PKG_NAME: platypush
GIT_PKG_NAME: platypush-git
AWS_ENDPOINT_URL: https://s3.nl-ams.scw.cloud
AWS_ACCESS_KEY_ID: aws_access_key_id
when:
branch:
- master
event:
- push
depends_on:
- build-ui
commands:
- echo "-- Installing dependencies"
- apt update
- apt install -y dpkg-dev gpg
- pip install awscli
- echo "--- Parsing metadata"
- git config --global --add safe.directory $PWD
- git pull --rebase origin master --tags
- export VERSION=$(python setup.py --version)
- export HEAD=$(git log --pretty=format:%h HEAD...HEAD~1)
- export GIT_VERSION="$VERSION.r$(git log --pretty=oneline HEAD...v$VERSION | wc -l).$HEAD"
- export TAG_URL="https://git.platypush.tech/platypush/platypush/archive/v$VERSION.tar.gz"
- export TAG_ARCHIVE="platypush-$VERSION.tar.gz"
- export GIT_BUILD_DIR="${WORKDIR}/${GIT_PKG_NAME}_${GIT_VERSION}_all"
- export PKGNAME="${PWD}/${GIT_PKG_NAME}_${GIT_VERSION}.deb"
- echo "--- Building git package"
- python setup.py install --prefix="$GIT_BUILD_DIR" --no-deps
- mkdir "${GIT_BUILD_DIR}/DEBIAN"
- |
cat <<EOF > "${GIT_BUILD_DIR}/DEBIAN/control"
Package: $GIT_PKG_NAME
Version: $GIT_VERSION
Maintainer: Fabio Manganiello <fabio@platypush.tech>
Depends: $(cat platypush/install/requirements/debian.txt | tr '\n' ' ')
Architecture: all
Homepage: https://platypush.tech
Description: Universal command executor and automation hub.
- dpkg --build "$GIT_BUILD_DIR"
- aws s3 cp "$PKGNAME" s3://platypush-static/deb/git/
- name: update-pip-package
image: python:3.11-alpine
environment:
@ -278,6 +328,7 @@ steps:
depends_on:
- update-pip-package
- update-arch-packages
- update-debian-packages
commands:
- apk add --update --no-cache curl
@ -303,6 +354,7 @@ steps:
depends_on:
- update-arch-packages
- update-debian-packages
commands:
- apk add --update --no-cache curl