Skip to content

Commit 95a52e4

Browse files
committed
Switch to use GitLab CI for ARM builds
1 parent 9cf6a0f commit 95a52e4

File tree

3 files changed

+198
-0
lines changed

3 files changed

+198
-0
lines changed

.gitlab-ci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
image: golang:1.10-stretch
2+
3+
variables:
4+
REPO_NAME: github.com/ernoaapa/eliot-os
5+
6+
stages:
7+
- test
8+
- build
9+
- publish
10+
11+
before_script:
12+
- go version
13+
# Move project under $GOPATH
14+
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
15+
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
16+
- cd $GOPATH/src/$REPO_NAME
17+
# Build tools
18+
- go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit
19+
# - go get -u github.com/estesp/manifest-tool
20+
# - go get -u github.com/tcnksm/ghr
21+
# Ensure jq is installed
22+
- apt-get install -y jq
23+
- echo '{}' | jq '.'
24+
# Configure Docker
25+
- ./build/install-docker.sh
26+
- echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
27+
28+
test:
29+
stage: test
30+
tags:
31+
- arm64
32+
script:
33+
- cd pkg
34+
- make forcebuild
35+
36+
publish:arm64:
37+
stage: publish
38+
tags:
39+
- arm64
40+
script:
41+
- cd pkg
42+
- GOOS=linux GOARCH=arm64 make forcepush
43+
44+
publish:armv6:
45+
stage: publish
46+
tags:
47+
- armv6
48+
script:
49+
- cd pkg
50+
- GOOS=linux GOARCH=arm GOARM=6 make forcepush
51+
52+
publish:armv7:
53+
stage: publish
54+
tags:
55+
- armv7
56+
script:
57+
- cd pkg
58+
- GOOS=linux GOARCH=arm GOARM=7 make forcepush

build/install-docker.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
apt-get update && apt-get install -y \
6+
apt-transport-https \
7+
ca-certificates \
8+
curl \
9+
software-properties-common
10+
11+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
12+
apt-key fingerprint 0EBFCD88
13+
add-apt-repository \
14+
"deb [arch=arm64] https://download.docker.com/linux/debian \
15+
$(lsb_release -cs) \
16+
stable"
17+
18+
apt-get update && apt-get install -y docker-ce
19+
20+
echo "Installed docker:"
21+
docker version

rpi3-persisted.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
kernel:
2+
image: linuxkit/kernel:4.14.27
3+
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
4+
init:
5+
- linuxkit/init:b212cfeb4bb6330e0a7547d8010fe2e8489b677a
6+
- linuxkit/runc:7c39a68490a12cde830e1922f171c451fb08e731
7+
- linuxkit/containerd:37e397ebfc6bd5d8e18695b121166ffd0cbfd9f0
8+
- linuxkit/ca-certificates:v0.2
9+
onboot:
10+
- name: sysctl
11+
image: linuxkit/sysctl:v0.2
12+
- name: netdev
13+
image: linuxkit/modprobe:v0.2
14+
# smsc95xx - https://github.com/linuxkit/linuxkit/blob/master/docs/platform-rpi3.md#networking
15+
# mmc_block - Load MMC block device driver so the sdcard is visible in /dev/mmc*
16+
command: ["modprobe", "-a", "smsc95xx", "mmc_block" ]
17+
- name: extend
18+
# Note: temporarily use ernoaapa/extend to extend the last partition
19+
# See: https://github.com/linuxkit/linuxkit/issues/2971
20+
image: ernoaapa/extend:187548787419ea12ce02025cc50cf6ff5d6bfc7a
21+
command: ["/usr/bin/extend", "/dev/mmcblk0"]
22+
- name: format
23+
image: linuxkit/format:v0.2
24+
command: ["/usr/bin/format", "-force", "-type", "ext4", "-label", "DATA", "-verbose", "/dev/sda"]
25+
- name: mount-disk
26+
image: linuxkit/mount:v0.2
27+
# command: ["/usr/bin/mountie", "/dev/mmcblk0p2", "/var"]
28+
command: ["/usr/bin/mountie", "-device", "/dev/sda1", "/var/foo"]
29+
binds:
30+
- /dev:/dev
31+
- /var:/var:rshared,rbind
32+
- /:/hostroot
33+
- /etc/fstab:/etc/fstab
34+
- /mnt:/mnt
35+
# - name: mount-fstab
36+
# image: linuxkit/mount:v0.2
37+
# binds:
38+
# - "/etc/fstab:/etc/fstab"
39+
# command: ["/bin/mount", "-a", "-v"]
40+
# - name: mount-tmp
41+
# image: linuxkit/mount:v0.2
42+
# command: ["/bin/sh", "-c", "mkdir -p /mnt/tmp && mount --bind /mnt/tmp /tmp"]
43+
# - name: mount-containers
44+
# image: linuxkit/mount:v0.2
45+
# command: ["/bin/sh", "-c", "mkdir -p /mnt/containers && mount --bind /mnt/containers /containers"]
46+
# - name: mount-var
47+
# image: linuxkit/mount:v0.2
48+
# command: ["/bin/sh", "-c", "mkdir -p /mnt/var && mount --bind /mnt/var /var"]
49+
- name: dhcpcd
50+
image: linuxkit/dhcpcd:v0.2
51+
# Halts until dhcpcd can resolve ip address
52+
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
53+
54+
services:
55+
- name: getty
56+
image: linuxkit/getty:v0.2
57+
env:
58+
# Makes the terminal open without password prompt
59+
- INSECURE=true
60+
binds:
61+
- "/etc/resolv.conf:/etc/resolv.conf"
62+
- "/run:/run"
63+
- "/tmp:/tmp"
64+
- "/etc:/hostroot/etc"
65+
- "/usr/bin/ctr:/usr/bin/ctr"
66+
- "/usr/bin/runc:/usr/bin/runc"
67+
- "/containers:/containers"
68+
- "/var/log:/var/log"
69+
- "/dev:/dev"
70+
- "/sys:/sys"
71+
- "/proc:/hostroot/proc"
72+
- "/var:/var"
73+
- "/var/foo:/var/foo"
74+
- name: ntpd
75+
image: linuxkit/openntpd:v0.2
76+
- name: dhcpcd
77+
image: linuxkit/dhcpcd:v0.2
78+
79+
- name: eliotd
80+
image: ernoaapa/eliotd:v0.2.8
81+
command: ["/eliotd", "--debug", "--profile", "--grpc-api-listen", "0.0.0.0:5000"]
82+
capabilities:
83+
- all
84+
net: host
85+
pid: host
86+
runtime:
87+
mkdir: ["/var/lib/volumes"]
88+
binds:
89+
- /containers:/containers
90+
- /var/lib/volumes:/var/lib/volumes
91+
- /var/lib/containerd:/var/lib/containerd
92+
- /run/containerd:/run/containerd
93+
- /etc/resolv.conf:/etc/resolv.conf
94+
- /etc/machine-id:/etc/machine-id
95+
- /var/log:/var/log # To be able to serve default containers logs through api
96+
- /tmp:/tmp # To be able to read temporary fifo log files
97+
- /run:/run
98+
- /dev:/dev
99+
- /sys:/sys
100+
101+
files:
102+
- path: /etc/issue
103+
contents: "welcome to EliotOS"
104+
- path: /etc/machine-id
105+
contents: "todo-generate"
106+
mode: "0600"
107+
# - path: /etc/fstab
108+
# contents: |
109+
# /mnt/containers /containers bind bind
110+
# /mnt/var/lib /var/lib bind bind
111+
# /mnt/var/log /var/log bind bind
112+
# /mnt/tmp /tmp bind bind
113+
trust:
114+
org:
115+
- linuxkit
116+
# image:
117+
# partitions:
118+
# - { start: 1048576, size: 104857600, boot: true, type: "fat32" } # 100MB partition for boot
119+
# - { start: 105906688, size: 52428800, type: "ext4" } # 50MB partition (get extended on boot) for persisted

0 commit comments

Comments
 (0)