Skip to content

Commit

Permalink
balena build scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
  • Loading branch information
petrosagg committed Oct 12, 2017
1 parent e9bda1d commit cc5fcd0
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile.build.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM resin/aarch64-golang:1.9

# Enable QEMU emulation
ENTRYPOINT [ "qemu-aarch64-static", "-execve" ]
SHELL [ "qemu-aarch64-static", "-execve", "/bin/sh", "-c" ]

RUN apt-get update \
&& apt-get install -y \
btrfs-tools \
libapparmor-dev \
libdevmapper-dev \
libnl-3-dev \
libsystemd-dev

COPY . /balena

WORKDIR /balena
18 changes: 18 additions & 0 deletions Dockerfile.build.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM resin/raspberrypi3-golang:1.9

# Enable QEMU emulation
ENTRYPOINT [ "qemu-arm-static", "-execve" ]
SHELL [ "qemu-arm-static", "-execve", "/bin/sh", "-c" ]

RUN apt-get update \
&& apt-get install -y \
btrfs-tools \
libapparmor-dev \
libdevmapper-dev \
libnl-3-dev \
libsystemd-dev \
libsystemd-journal-dev

COPY . /balena

WORKDIR /balena
13 changes: 13 additions & 0 deletions Dockerfile.build.i386
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM i386/golang:1.9

RUN apt-get update \
&& apt-get install -y \
btrfs-tools \
libapparmor-dev \
libdevmapper-dev \
libnl-3-dev \
libsystemd-dev

COPY . /balena

WORKDIR /balena
40 changes: 40 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

set -o errexit

case "$(go env GOARCH)" in
"arm")
arch="armv$(go env GOARM)"
;;
"arm64")
arch="aarch64"
;;
"386")
arch="i386"
;;
"amd64")
arch="x86_64"
;;
esac

version=$(git describe --tags --always)

AUTO_GOPATH=1 ./hack/make.sh dynbinary-balena

src="bundles/latest/dynbinary-balena"
dst="balena"

rm -rf "$dst"
mkdir "$dst"

cp -L "$src/balena" "$dst/balena"
strip "$dst/balena"

ln -s balena "$dst/balenad"
ln -s balena "$dst/balena-containerd"
ln -s balena "$dst/balena-containerd-ctr"
ln -s balena "$dst/balena-containerd-shim"
ln -s balena "$dst/balena-proxy"
ln -s balena "$dst/balena-runc"

tar czfv "balena-$version-$arch.tar.gz" "$dst" .
37 changes: 37 additions & 0 deletions contrib/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

tag="17.06-rc5+testtag"

machine=$(uname -m)

case "$machine" in
"armv5"*)
arch="armv5"
;;
"armv6"*)
arch="armv6"
;;
"armv7"*)
arch="armv7"
;;
"armv8"*)
arch="aarch64"
;;
"aarch64"*)
arch="aarch64"
;;
"i386")
arch="i386"
;;
"i686")
arch="i386"
;;
"x86_64")
arch="amd64"
;;
*)
echo "Unknown machine type: $machine"
exit 1
esac

curl -sSL "https://github.com/resin-os/balena/releases/download/${tag}/balena-${tag}-${arch}.tar.gz" | tar tz

0 comments on commit cc5fcd0

Please sign in to comment.