From 7d131e2747f2b6fb8747561907153b9a4586b5e3 Mon Sep 17 00:00:00 2001 From: Aravinda Vishwanathapura Date: Wed, 12 Oct 2022 19:20:14 +0530 Subject: [PATCH 1/2] Retain existing output directory Signed-off-by: Aravinda Vishwanathapura --- generate_deb_packages.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generate_deb_packages.sh b/generate_deb_packages.sh index d2edcb7..8bfe0d0 100755 --- a/generate_deb_packages.sh +++ b/generate_deb_packages.sh @@ -53,7 +53,17 @@ debmake -b":python3" debuild cd ../../ -# TODO: Clone the existing repo and checkout gh-pages to get the current output directory +# Clone the existing repo and checkout gh-pages to get the current output directory +git clone https://github.com/kadalu-tech/pkgs.git build/output +cd build/output +git checkout -b gh-pages origin/gh-pages +cd ../../ + +rm -rf output +mkdir output +# TODO: Add previous versions when a new version is released +cp -r build/output/${MAJOR_VERSION} output/${MAJOR_VERSION} + output_dir=output/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION} rm -rf ${output_dir} mkdir -p ${output_dir} From 7c80a4b12f2de1fa67c89274c6740721904cbccb Mon Sep 17 00:00:00 2001 From: Aravinda Vishwanathapura Date: Wed, 12 Oct 2022 19:24:58 +0530 Subject: [PATCH 2/2] Packages for Ubuntu 22.04 Signed-off-by: Aravinda Vishwanathapura --- .../workflows/on-pr-merge-ubuntu-2204.yaml | 41 +++++++++ .github/workflows/on-pr-merge.yaml | 2 +- generate_deb_packages_ubuntu_2204.sh | 90 +++++++++++++++++++ 3 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/on-pr-merge-ubuntu-2204.yaml create mode 100644 generate_deb_packages_ubuntu_2204.sh diff --git a/.github/workflows/on-pr-merge-ubuntu-2204.yaml b/.github/workflows/on-pr-merge-ubuntu-2204.yaml new file mode 100644 index 0000000..63dff82 --- /dev/null +++ b/.github/workflows/on-pr-merge-ubuntu-2204.yaml @@ -0,0 +1,41 @@ +name: After merging PR + +on: + push: + branches: + - main + - build_test + + # Allow to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + devel-tag-push: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + # TODO: Review the below list of dependencies + - name: Install the Build dependencies + run: | + sudo apt update -y + sudo apt install -y libunwind-dev + sudo apt install -y --no-install-recommends python3 libtirpc3 init \ + python3-pip ssh rsync lvm2 less software-properties-common \ + sudo curl wget git build-essential automake autoconf automake libtool \ + flex bison libssl-dev pkg-config uuid-dev acl-dev zlib1g-dev \ + libxml2-dev libxml2-utils liburcu-dev xfsprogs gdb attr \ + libgoogle-perftools-dev zfsutils-linux screen libsqlite3-dev sqlite3 \ + debmake python3-debian debhelper dh-python \ + libaio-dev libdb-dev libfuse-dev libibverbs-dev liblvm2-dev \ + libncurses5-dev librdmacm-dev libreadline-dev python3-all-dev + - name: Install Crystal + run: | + curl -fsSL https://crystal-lang.org/install.sh | sudo bash + - name: Build Debian packages + run: | + PACKAGING_GPG_SIGNING_KEY="${{ secrets.PACKAGING_GPG_SIGNING_KEY }}" ./generate_deb_packages_ubuntu_2204.sh + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./output diff --git a/.github/workflows/on-pr-merge.yaml b/.github/workflows/on-pr-merge.yaml index 01d8b55..2fb7879 100644 --- a/.github/workflows/on-pr-merge.yaml +++ b/.github/workflows/on-pr-merge.yaml @@ -11,7 +11,7 @@ on: jobs: devel-tag-push: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 # TODO: Review the below list of dependencies diff --git a/generate_deb_packages_ubuntu_2204.sh b/generate_deb_packages_ubuntu_2204.sh new file mode 100644 index 0000000..7d33017 --- /dev/null +++ b/generate_deb_packages_ubuntu_2204.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +set -e + +MOANA_BRANCH=1.0.0-beta.1 +GLUSTERFS_BRANCH=kadalu_1 +DISTRO_VERSION=22.04 +DISTRO=ubuntu +VERSION=1.0.0-beta.1 +MAJOR_VERSION=1 +PKG_KADALU_STORAGE_MANAGER=kadalu-storage-manager +PKG_KADALU_STORAGE=kadalu-storage + +rm -rf build +mkdir -p build + +# Clone and Checkout GlusterFS +git clone https://github.com/kadalu/glusterfs.git build/${PKG_KADALU_STORAGE}-${VERSION} +cd build/${PKG_KADALU_STORAGE}-${VERSION} +git checkout -b ${GLUSTERFS_BRANCH} origin/${GLUSTERFS_BRANCH} +cd ../../ + +# Clone and Checkout Moana +git clone https://github.com/kadalu/moana.git build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION} +cd build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION} +git fetch --all --tags +git checkout -b ${MOANA_BRANCH} tags/${MOANA_BRANCH} +cd ../../ + +# Create tar +cd build/ +tar cvzf ${PKG_KADALU_STORAGE_MANAGER}-${VERSION}.tar.gz ${PKG_KADALU_STORAGE_MANAGER}-${VERSION} +tar cvzf ${PKG_KADALU_STORAGE}-${VERSION}.tar.gz ${PKG_KADALU_STORAGE}-${VERSION} +cd .. + +# Copy Debian meta files +cp -r build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/packaging/moana/debian build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/ +cp -r build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/packaging/glusterfs/debian build/${PKG_KADALU_STORAGE}-${VERSION}/ + +# Overwrite the Changelog file +cp changelogs/moana/changelog-${MAJOR_VERSION} build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/debian/changelog +cp changelogs/glusterfs/changelog-${MAJOR_VERSION} build/${PKG_KADALU_STORAGE}-${VERSION}/debian/changelog + +# Build Moana deb packages +cd build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/ +debmake -b":python3" +debuild -eVERSION=${VERSION} +cd ../../ + +# Build GlusterFS deb packages +cd build/${PKG_KADALU_STORAGE}-${VERSION}/ +debmake -b":python3" +debuild +cd ../../ + +# Clone the existing repo and checkout gh-pages to get the current output directory +git clone https://github.com/kadalu-tech/pkgs.git build/output +cd build/output +git checkout -b gh-pages origin/gh-pages +cd ../../ + +rm -rf output +mkdir output +# TODO: Add previous versions when a new version is released +cp -r build/output/${MAJOR_VERSION} output/${MAJOR_VERSION} + +output_dir=output/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION} +rm -rf ${output_dir} +mkdir -p ${output_dir} + +# Copy generated Deb files +cp build/*.deb ${output_dir}/ + +# List of packages +cd ${output_dir} +dpkg-scanpackages --multiversion . > Packages +gzip -k -f Packages + +# Import the Signing key from env var +echo -n "$PACKAGING_GPG_SIGNING_KEY" | base64 --decode | gpg --import +gpg --list-keys + +# Release, Release.gpg & InRelease +apt-ftparchive release . > Release +gpg --local-user "packaging@kadalu.tech" -abs -o - Release > Release.gpg +gpg --local-user "packaging@kadalu.tech" --clearsign -o - Release > InRelease +gpg --armor --export "packaging@kadalu.tech" > KEY.gpg + +echo "deb https://kadalu.tech/pkgs/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION} ./" > sources.list +cd ../../../../