.gitlab-ci.yml 2.01 KB
Newer Older
rgaudin's avatar
rgaudin committed
1
image: "python:3.7"
rgaudin's avatar
rgaudin committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

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
rgaudin's avatar
rgaudin committed
22
    - wget http://mirror.download.kiwix.org/dev/vexpress-boot.zip
23
    - unzip vexpress-boot.zip
rgaudin's avatar
rgaudin committed
24
25

    # download a static qemu
rgaudin's avatar
rgaudin committed
26
    - wget http://mirror.download.kiwix.org/dev/qemu-2.12.0-linux-x86_64.tar.gz
rgaudin's avatar
rgaudin committed
27
28
    - tar xf qemu-2.12.0-linux-x86_64.tar.gz

29
    # download etcher-cli (not used but packaged)
rgaudin's avatar
rgaudin committed
30
    - wget http://download.kiwix.org/dev/balena-etcher-cli-1.4.8-linux-x64.tar.gz
31
    - mkdir -p etcher-cli
rgaudin's avatar
rgaudin committed
32
    - tar xf balena-etcher-cli-1.4.8-linux-x64.tar.gz -C etcher-cli --strip-components=1
33

34
35
36
37
38
    # download aria2c (not used but packaged)
    - wget http://download.kiwix.org/dev/aria2c-linux64.zip
    - unzip aria2c-linux64.zip
    - rm aria2c-linux64.zip

rgaudin's avatar
rgaudin committed
39
    # Install python dependancies
rgaudin's avatar
rgaudin committed
40
    - pip3 install -U pip
rgaudin's avatar
rgaudin committed
41
42
43
    - pip3 install -r requirements-linux.txt

    # Install and run pyinstaller
rgaudin's avatar
rgaudin committed
44
    - pip3 install -U pyinstaller
45
    - pyinstaller --log-level=DEBUG kiwix-hotspot-linux.spec
rgaudin's avatar
rgaudin committed
46
47

    # start image builder
48
49
    - eval "export OUT_IMG=hotspot-master_$(date +"%Y-%m-%d").img"
    - dist/kiwix-hotspot image --ram 8G --root 7 --size 8 --out ${OUT_IMG}
rgaudin's avatar
rgaudin committed
50
    - zip -9 ${OUT_IMG}.zip ${OUT_IMG}
51
    - scp ${OUT_IMG}.zip ci@download.kiwix.org:/data/download/hotspots/base/
rgaudin's avatar
rgaudin committed
52
53
54
  only:
    - schedules
    - web