Skip to content

Commit

Permalink
fix(scripts/build-release): use cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Philips committed Feb 7, 2014
1 parent 102d8e5 commit 0c2287b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions scripts/build-release
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,29 @@ function package {
proj=${1}
target=${2}

cp ${proj}/${proj} ${target}
ccdir="${proj}/bin/${GOOS}_${GOARCH}"
if [ -d ${ccdir} ]; then
cp ${ccdir}/${proj}* ${target}
else
cp ${proj}/bin/${proj} ${target}
fi

cp ${proj}/README.md ${target}/README-${proj}.md
}

build etcd ${VER}
build etcdctl ${VER}

TARGET="etcd-$VER-$(uname -s)-$(uname -m)"
mkdir ${TARGET}
for i in darwin windows linux; do
export GOOS=${i}
export GOARCH="amd64"

build etcd ${VER}
build etcdctl ${VER}

TARGET="etcd-${VER}-${GOOS}-${GOARCH}"
mkdir ${TARGET}

package etcd ${TARGET}
package etcdctl ${TARGET}
package etcd ${TARGET}
package etcdctl ${TARGET}

tar cvvfz ${TARGET}.tar.gz ${TARGET}
tar cvvfz ${TARGET}.tar.gz ${TARGET}
done

0 comments on commit 0c2287b

Please sign in to comment.