This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
55 lines (46 loc) · 2.07 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
image: "python:3.7"
before_script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y locales openssh-client wget zip unzip tar python3-gi python3-gi-cairo python3-cairo gir1.2-gtk-3.0 libdbus-1-dev libdbus-glib-1-dev libffi-dev build-essential libssl-dev python3-dev libgdk-pixbuf2.0-dev
- sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8
# SSH key and known hosts handling
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan download.kiwix.org >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
build-pibox-image:
stage: build
variables:
LANG: 'en_US.UTF-8'
script:
# download custom kernel
- wget http://mirror.download.kiwix.org/dev/vexpress-boot.zip
- unzip vexpress-boot.zip
# download a static qemu
- wget http://mirror.download.kiwix.org/dev/qemu-2.12.0-linux-x86_64.tar.gz
- tar xf qemu-2.12.0-linux-x86_64.tar.gz
# download etcher-cli (not used but packaged)
- wget http://download.kiwix.org/dev/balena-etcher-cli-1.4.8-linux-x64.tar.gz
- mkdir -p etcher-cli
- tar xf balena-etcher-cli-1.4.8-linux-x64.tar.gz -C etcher-cli --strip-components=1
# download aria2c (not used but packaged)
- wget http://download.kiwix.org/dev/aria2c-linux64.zip
- unzip aria2c-linux64.zip
- rm aria2c-linux64.zip
- wget http://download.kiwix.org/dev/ca-certificates.crt
# Install python dependancies
- pip3 install -U pip
- pip3 install -r requirements-linux.txt
# Install and run pyinstaller
- pip3 install -U pyinstaller
- pyinstaller --log-level=DEBUG kiwix-hotspot-linux.spec
# start image builder
- eval "export OUT_IMG=hotspot-master_$(date +"%Y-%m-%d").img"
- dist/kiwix-hotspot image --ram 8G --root 7 --size 8 --out ${OUT_IMG}
- zip -9 ${OUT_IMG}.zip ${OUT_IMG}
- scp ${OUT_IMG}.zip [email protected]:/data/download/hotspots/base/
only:
- schedules
- web