Pass the multiarch environment variables

This commit is contained in:
Leo Arias 2017-11-16 04:13:25 +00:00
parent 58a884373b
commit 980c812d20
3 changed files with 20 additions and 4 deletions

View File

@ -4,4 +4,4 @@
set -ev
docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq && cd $(pwd) && for arch in amd64 i386 armhf arm64; do snapcraft snap --target-arch \$arch && snapcraft clean && snapcraft push ipfs-cluster*\$arch.snap --release edge; done"
docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq && cd $(pwd) && ./snap/snap-multiarch.sh"

15
snap/snap-multiarch.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
#
# Build the ipfs-cluster snaps and push them to the store.
set -ev
snap() {
snapcraft clean
ARCH_TRIPLET=$1 TARGET_GOARCH=$2 snapcraft --target-arch $3
snapcraft push ipfs-cluster*$3.snap --release edge
}
snap x86_64-linux-gnu amd64 amd64
snap arm-linux-gnueabihf arm armhf
snap aarch64-linux-gnu arm64 arm64

View File

@ -25,11 +25,12 @@ parts:
mkdir -p ../go/src/github.com/ipfs/ipfs-cluster
cp -R . ../go/src/github.com/ipfs/ipfs-cluster
build: |
env GOPATH=$(pwd)/../go make -C ../go/src/github.com/ipfs/ipfs-cluster install
env GOPATH=$(pwd)/../go CC=$ARCH_TRIPLET-gcc CXX=$ARCH_TRIPLET-g++ CGO_ENABLED=1 GOARCH=$TARGET_GOARCH make -C ../go/src/github.com/ipfs/ipfs-cluster install
install: |
mkdir $SNAPCRAFT_PART_INSTALL/bin
mv ../go/bin/ipfs-cluster-service $SNAPCRAFT_PART_INSTALL/bin/
mv ../go/bin/ipfs-cluster-ctl $SNAPCRAFT_PART_INSTALL/bin/
for file in $(find ../go/bin/ -type f); do
mv $file $SNAPCRAFT_PART_INSTALL/bin/
done
after: [go]
go:
source-tag: go1.9.2