Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Commit 5dc3e0a

Browse files
authored
Merge pull request #114 from learningequality/refactor/makefile-setup-targets
Extract setup steps into Makefile, rewrite install test workflow
2 parents 97c6b19 + 8b03666 commit 5dc3e0a

5 files changed

Lines changed: 93 additions & 90 deletions

File tree

.github/workflows/build_debian.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
steps:
4444
- name: checkout codebase
4545
uses: actions/checkout@v4
46-
- name: Install build dependencies and launchpadlib
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y build-essential devscripts debhelper dpkg-dev dput python3-launchpadlib
46+
- name: Install build and upload dependencies
47+
run: make install-upload-deps
48+
- name: Install Kolibri
49+
run: make install-kolibri
5050
- name: Write Launchpad credentials
5151
env:
5252
LP_CREDENTIALS: ${{ secrets.LP_CREDENTIALS }}
@@ -68,15 +68,12 @@ jobs:
6868
if: steps.check_source.outputs.already_uploaded != 'true'
6969
run: |
7070
echo -n "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode | gpg --import --no-tty --batch --yes
71-
- name: sign and upload package
71+
- name: Sign and upload package
7272
if: steps.check_source.outputs.already_uploaded != 'true'
7373
env:
7474
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7575
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
76-
run: |
77-
echo "Signing package..."
78-
make sign-and-upload
79-
echo "upload completed successfully!"
76+
run: make sign-and-upload
8077
- name: Cleanup Launchpad credentials
8178
if: always()
8279
run: rm -f /tmp/lp-creds.txt

.github/workflows/installtest.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,56 @@ on:
77
- 'v*'
88
pull_request:
99
jobs:
10-
install_test:
11-
name: Run installation of kolibri-server in docker image
10+
build:
11+
name: Build kolibri-server .deb package
1212
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout codebase
15+
uses: actions/checkout@v4
16+
- name: Install build dependencies
17+
run: make install-build-deps
18+
- name: Install Kolibri
19+
run: make install-kolibri
20+
- name: Build .deb package
21+
run: |
22+
make deb
23+
cp ../kolibri-server_*.deb ./kolibri-server.deb
24+
- name: Upload .deb artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: kolibri-server-deb
28+
path: kolibri-server.deb
29+
install_test:
30+
name: Install on ${{ matrix.target-image }} (${{ matrix.runner }})
31+
needs: build
32+
runs-on: ${{ matrix.runner }}
33+
container: ${{ matrix.target-image }}
1334
strategy:
14-
max-parallel: 5
35+
max-parallel: 10
1536
matrix:
16-
target-image: ['ubuntu:20.04', 'ubuntu:22.04', 'debian:bullseye', 'debian:bookworm']
37+
target-image: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:24.04', 'debian:bullseye', 'debian:bookworm']
38+
runner: ['ubuntu-latest', 'ubuntu-24.04-arm']
1739
steps:
1840
- name: Checkout codebase
1941
uses: actions/checkout@v4
20-
- name: Set up QEMU
21-
uses: docker/setup-qemu-action@v3
22-
- name: Set up Docker Buildx
23-
uses: docker/setup-buildx-action@v3
24-
- name: Run installation on ${{ matrix.target-image }}
25-
uses: docker/build-push-action@v6
42+
- name: Setup environment
43+
run: |
44+
apt-get update
45+
apt-get install -y gpg tzdata
46+
rm -f /etc/localtime
47+
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
48+
dpkg-reconfigure -f noninteractive tzdata
49+
- name: Setup Kolibri PPA
50+
run: ./test/setup_ppa.sh
51+
- name: Configure debconf selections
52+
run: |
53+
echo "kolibri kolibri/init boolean false" | debconf-set-selections
54+
echo "kolibri kolibri/user string kolibri" | debconf-set-selections
55+
echo "kolibri-server kolibri-server/port select 8080" | debconf-set-selections
56+
echo "kolibri-server kolibri-server/zip_content_port select 8081" | debconf-set-selections
57+
- name: Download .deb artifact
58+
uses: actions/download-artifact@v4
2659
with:
27-
build-args: |
28-
TARGET_IMAGE=${{ matrix.target-image }}
29-
context: ./
30-
file: ./test/Dockerfile
31-
platforms: linux/amd64,linux/arm64
32-
push: false
33-
target: test
34-
provenance: false
60+
name: kolibri-server-deb
61+
- name: Install kolibri-server
62+
run: apt-get update && apt-get install -y ./kolibri-server.deb

Makefile

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
1-
.PHONY: help error-pages deb dist config-nginx orig
1+
.PHONY: help error-pages deb dist config-nginx orig \
2+
setup-ppa install-build-deps install-upload-deps install-kolibri
3+
4+
# Auto-detect sudo: empty in containers (root), "sudo" on dev machines
5+
SUDO := $(shell [ "$$(id -u)" = "0" ] && echo "" || echo "sudo")
6+
APT_UPDATE := $(SUDO) apt-get update
7+
APT_INSTALL := $(SUDO) apt-get install -y
28

39
help:
4-
@echo "changelog - prepare debian/chanelog file with the new version number"
5-
@echo "error-pages - use kolibri command to create all the error pages and its translations"
6-
@echo "release - prepare a release"
7-
@echo "dist - package"
8-
@echo "orig - creates ../kolibri-server_n.n.n.orig.tar.gz"
10+
@echo "changelog - prepare debian/changelog file with the new version number"
11+
@echo "error-pages - use kolibri command to create all the error pages and its translations"
12+
@echo "release - prepare a release"
13+
@echo "dist - package"
14+
@echo "orig - creates ../kolibri-server_n.n.n.orig.tar.gz"
15+
@echo "setup-ppa - add Learning Equality PPA"
16+
@echo "install-build-deps - install devscripts, debhelper, dpkg-dev"
17+
@echo "install-upload-deps- install build deps + dput, python3-launchpadlib"
18+
@echo "install-kolibri - preseed debconf and install kolibri from PPA"
919
@echo $(shell dpkg-parsechangelog -SVersion)
1020

21+
setup-ppa:
22+
$(APT_INSTALL) gpg
23+
./test/setup_ppa.sh
24+
25+
install-build-deps:
26+
$(APT_UPDATE)
27+
$(APT_INSTALL) build-essential devscripts debhelper dpkg-dev
28+
29+
install-upload-deps: install-build-deps
30+
$(APT_INSTALL) dput python3-launchpadlib
31+
32+
install-kolibri: setup-ppa
33+
echo "kolibri kolibri/init boolean false" | $(SUDO) debconf-set-selections
34+
echo "kolibri kolibri/user string kolibri" | $(SUDO) debconf-set-selections
35+
$(APT_UPDATE)
36+
$(APT_INSTALL) kolibri
37+
1138
error-pages:
1239
rm -Rf $(CURDIR)/error_pages
1340
kolibri manage loadingpage --reload --output-dir $(CURDIR)/error_pages --version-text $(shell dpkg-parsechangelog -SVersion)
@@ -17,10 +44,10 @@ changelog:
1744

1845
release: changelog error-pages orig
1946

20-
deb: orig
47+
deb: error-pages orig
2148
dpkg-buildpackage -b -us -uc
2249

23-
dist: orig
50+
dist: error-pages orig
2451
@mkdir -p dist
2552
echo "Building unsigned package..."
2653
dpkg-buildpackage -S -us -uc --output-directory=dist/

test/Dockerfile

Lines changed: 0 additions & 53 deletions
This file was deleted.

test/setup_ppa.sh

100644100755
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
set -e
44

5+
SUDO=""
6+
[ "$(id -u)" != "0" ] && SUDO="sudo"
7+
58
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys DC5BAA93F9E4AE4F0411F97C74F88ADB3194DD81
6-
gpg --output /usr/share/keyrings/learningequality-kolibri.gpg --export DC5BAA93F9E4AE4F0411F97C74F88ADB3194DD81
9+
gpg --output /tmp/learningequality-kolibri.gpg --export DC5BAA93F9E4AE4F0411F97C74F88ADB3194DD81
10+
$SUDO mv /tmp/learningequality-kolibri.gpg /usr/share/keyrings/learningequality-kolibri.gpg
711

812
echo "deb [signed-by=/usr/share/keyrings/learningequality-kolibri.gpg] http://ppa.launchpad.net/learningequality/kolibri/ubuntu jammy main" \
9-
> /etc/apt/sources.list.d/learningequality-ubuntu-kolibri.list
13+
| $SUDO tee /etc/apt/sources.list.d/learningequality-ubuntu-kolibri.list > /dev/null

0 commit comments

Comments
 (0)