From 324e5ea8bcd6b7987e29acda6885ad505264b316 Mon Sep 17 00:00:00 2001 From: timo Date: Thu, 20 Jun 2024 14:25:03 +0200 Subject: [PATCH] Build deb packages for the html-plugin --- .../workflows/build-plugin-deb-package.yml | 60 +++++++++++++++++++ .github/workflows/publish-on-pypi.yml | 2 + .github/workflows/test-pairing-server.yml | 4 ++ .gitignore | 5 ++ html-plugin/.setup-build-dependencies.sh | 14 +++++ html-plugin/README.md | 14 ++++- html-plugin/debian/changelog | 5 ++ html-plugin/debian/compat | 1 + html-plugin/debian/control | 13 ++++ html-plugin/debian/copyright | 21 +++++++ html-plugin/debian/rules | 12 ++++ 11 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-plugin-deb-package.yml create mode 100755 html-plugin/.setup-build-dependencies.sh create mode 100644 html-plugin/debian/changelog create mode 100644 html-plugin/debian/compat create mode 100644 html-plugin/debian/control create mode 100644 html-plugin/debian/copyright create mode 100755 html-plugin/debian/rules diff --git a/.github/workflows/build-plugin-deb-package.yml b/.github/workflows/build-plugin-deb-package.yml new file mode 100644 index 0000000..77c32bc --- /dev/null +++ b/.github/workflows/build-plugin-deb-package.yml @@ -0,0 +1,60 @@ +--- +name: 📦 Build .deb-package for html-plugin +on: + push: + branches: [ "main"] + paths: + - 'html-plugin/**' + pull_request: + branches: [ "main" ] + paths: + - 'html-plugin/**' + +jobs: + build-deb-package: + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./html-plugin + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Install build dependencies + run: sudo ./.setup-build-dependencies.sh + + - run: node --version + + - name: Build Debian package + run: sudo dpkg-buildpackage -us -uc + + - name: Upload Debian Package + uses: actions/upload-artifact@v4 + with: + name: html-plugin-ubuntu-22.04 + path: "${{ github.workspace }}/*.deb" + + release: + name: "Upload assets to release" + needs: build-deb-package + runs-on: ubuntu-latest + if: ${{ github.ref_type == 'tag' }} + permissions: + contents: write + actions: read + + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: html-plugin-ubuntu-22.04 + path: html-plugin-ubuntu-22.04 + + - name: Create release asset archives + run: zip --junk-paths --recurse-paths --compression-method store "html-plugin-ubuntu-22.04.zip" "html-plugin-ubuntu-22.04" + + - name: Upload release assets + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.ref_name }} "html-plugin-ubuntu-22.04.zip" diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml index 61ab462..c9a8868 100644 --- a/.github/workflows/publish-on-pypi.yml +++ b/.github/workflows/publish-on-pypi.yml @@ -3,6 +3,8 @@ name: Publish the pairing server 📦 to PyPI and TestPyPI on: push: + paths: + - 'pairing-server/**' defaults: run: diff --git a/.github/workflows/test-pairing-server.yml b/.github/workflows/test-pairing-server.yml index 86f465f..01c93c9 100644 --- a/.github/workflows/test-pairing-server.yml +++ b/.github/workflows/test-pairing-server.yml @@ -5,7 +5,11 @@ on: push: branches-ignore: - 'dependabot/**' + paths: + - 'pairing-server/**' pull_request: + paths: + - 'pairing-server/**' defaults: run: diff --git a/.gitignore b/.gitignore index 6f3f35b..39ffeb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ html-plugin/.idea html-plugin/dist html-plugin/node_modules +html-plugin/debian/bbb-room-connector-plugin/ +html-plugin/debian/bbb-room-connector-plugin.substvars +html-plugin/debian/files +html-plugin/debian/debhelper-build-stamp .DS_Store appliance-application/dist appliance-application/node_modules @@ -35,3 +39,4 @@ venv/ __pycache__ .pytest_cache/ + diff --git a/html-plugin/.setup-build-dependencies.sh b/html-plugin/.setup-build-dependencies.sh new file mode 100755 index 0000000..5fb6ac5 --- /dev/null +++ b/html-plugin/.setup-build-dependencies.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# This script installs the build dependencies for the HTML plugin debian package. +# Do not use the github action node-setup, because it will not work with the debian package build. + +set -eux + +apt-get update +apt-get install -y build-essential devscripts debhelper lintian ca-certificates curl gnupg +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +apt-get update +apt-get install -y nodejs diff --git a/html-plugin/README.md b/html-plugin/README.md index 10cb05b..d7dc7d6 100644 --- a/html-plugin/README.md +++ b/html-plugin/README.md @@ -58,7 +58,7 @@ public: - name: RoomMediaPlugin url: <> settings: - pairingWebsocketUrl: wss://your-bbb-server.org/hybrid/ws + pairingWebsocketUrl: wss://your-pairing-server.org/hybrid/ws ``` #### Hosting the Plugin on a BBB Server @@ -67,3 +67,15 @@ While the plugin can be hosted on any Server, it is also possible to host the bu a BigBlueButton server. For that you copy the `dist/RoomMediaPlugin.js` to the folder `/var/www/bigbluebutton-default/assets/plugins`. In this case, the `<>` above will be `https:///plugins/RoomMediaPlugin.js`. + +### Installation as a .deb-Package + +We build debian packages for the main branch and releases. + +For releases you can download them from the assets on the releases page. +For commits and PRs on the main-branch you can download them as artifacts from the respective actions workflow. + +You can then install the package on your BBB server using something like `dpkg -i bbb-room-connector-plugin_0.1.0_all.deb` +(verify the actual file name of the .deb-package). +The plugin is then automatically installed to `/var/www/bigbluebutton-default/assets/plugins` and is delivered by BBB. +You then only need to configure it according to the example above. diff --git a/html-plugin/debian/changelog b/html-plugin/debian/changelog new file mode 100644 index 0000000..40a9948 --- /dev/null +++ b/html-plugin/debian/changelog @@ -0,0 +1,5 @@ +bbb-room-connector-plugin (0.1.0) jammy; urgency=medium + + * initial build + + -- Timo Nogueira Brockmeyer Thu, 20 Jun 2024 14:56:14 -0400 diff --git a/html-plugin/debian/compat b/html-plugin/debian/compat new file mode 100644 index 0000000..ca7bf83 --- /dev/null +++ b/html-plugin/debian/compat @@ -0,0 +1 @@ +13 \ No newline at end of file diff --git a/html-plugin/debian/control b/html-plugin/debian/control new file mode 100644 index 0000000..e8007cc --- /dev/null +++ b/html-plugin/debian/control @@ -0,0 +1,13 @@ +Source: bbb-room-connector-plugin +Section: web +Priority: extra +Maintainer: Timo Nogueira Brockmeyer +Build-Depends: debhelper (>= 13), nodejs (>= 18) +Standards-Version: 4.1.4 + +Package: bbb-room-connector-plugin +Architecture: all +Depends: ${misc:Depends}, nodejs +Description: The BigBlueButton room connector plugin + A BigBlueButton plugin to connect a meeting to a room appliance + (as a bring-your-own-meeting functionality). diff --git a/html-plugin/debian/copyright b/html-plugin/debian/copyright new file mode 100644 index 0000000..805a924 --- /dev/null +++ b/html-plugin/debian/copyright @@ -0,0 +1,21 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: bbb-room-connector-plugin + +Files: * +Copyright: 2024 BigBlueButton Inc. and by respective authors +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + version 3.0 can be found in "/usr/share/common-licenses/GPL-3.0". diff --git a/html-plugin/debian/rules b/html-plugin/debian/rules new file mode 100755 index 0000000..c691778 --- /dev/null +++ b/html-plugin/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +%: + dh $@ --no-parallel --verbose + +override_dh_auto_build: + npm install + npm run build-bundle + +override_dh_auto_install: + install -d debian/bbb-room-connector-plugin/var/www/bigbluebutton-default/assets/plugins/bbb-room-connector-plugin + cp -r dist/* debian/bbb-room-connector-plugin/var/www/bigbluebutton-default/assets/plugins/bbb-room-connector-plugin