forked from product-os/golang-arm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins_build.sh
executable file
·56 lines (53 loc) · 1.73 KB
/
jenkins_build.sh
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
56
#!/bin/bash
# Jenkins build steps
for ARCH in $ARCHS
do
case "$ARCH" in
'armv6hf')
sed -e s~#{FROM}~resin/rpi-raspbian:jessie~g \
-e s~#{QEMU}~"COPY qemu/qemu-arm-static /usr/bin/"~g Dockerfile.debian.tpl > Dockerfile
;;
'armv7hf')
sed -e s~#{FROM}~resin/armv7hf-debian:jessie~g \
-e s~#{QEMU}~"COPY qemu/qemu-arm-static /usr/bin/"~g Dockerfile.debian.tpl > Dockerfile
;;
'armel')
sed -e s~#{FROM}~resin/armel-debian:jessie~g \
-e s~#{QEMU}~"COPY qemu/qemu-arm-static /usr/bin/"~g Dockerfile.debian.tpl > Dockerfile
;;
'aarch64')
sed -e s~#{FROM}~resin/aarch64-debian:jessie~g \
-e s~#{QEMU}~"COPY qemu/qemu-aarch64-static /usr/bin/"~g Dockerfile.debian.tpl > Dockerfile
;;
'i386')
sed -e s~#{FROM}~resin/i386-debian:jessie~g \
-e s~#{QEMU}~""~g Dockerfile.debian.tpl > Dockerfile
;;
'alpine-armhf')
sed -e s~#{FROM}~resin/armhf-alpine:3.6~g \
-e s~#{QEMU}~"COPY qemu/qemu-arm-static /usr/bin/"~g Dockerfile.alpine.tpl > Dockerfile
;;
'alpine-i386')
sed -e s~#{FROM}~resin/i386-alpine:3.6~g \
-e s~#{QEMU}~""~g Dockerfile.alpine.tpl > Dockerfile
;;
'alpine-amd64')
sed -e s~#{FROM}~resin/amd64-alpine:3.6~g \
-e s~#{QEMU}~""~g Dockerfile.alpine.tpl > Dockerfile
;;
'alpine-aarch64')
sed -e s~#{FROM}~resin/aarch64-alpine:3.6~g \
-e s~#{QEMU}~"COPY qemu/qemu-aarch64-static /usr/bin/"~g Dockerfile.alpine.tpl > Dockerfile
;;
esac
docker build -t go-$ARCH-builder .
for GO_VERSION in $GO_VERSIONS
do
docker run --rm -e ARCH=$ARCH \
-e ACCESS_KEY=$ACCESS_KEY \
-e SECRET_KEY=$SECRET_KEY \
-e BUCKET_NAME=$BUCKET_NAME go-$ARCH-builder bash -ex build.sh $GO_VERSION
done
done
# Clean up builder image after every run
docker rmi -f go-$ARCH-builder