2017-09-26 11:14:13 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set +e
|
|
|
|
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
error "Please set the 'version' variable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# the temp folder to store binary file...
|
|
|
|
mkdir -p binary
|
2017-09-26 11:52:34 +02:00
|
|
|
rm -rf binary/notary-server || true
|
|
|
|
rm -rf binary/notary-signer || true
|
2017-09-26 11:14:13 +02:00
|
|
|
|
|
|
|
cd `dirname $0`
|
|
|
|
cur=$PWD
|
|
|
|
|
|
|
|
# the temp folder to store notary source code...
|
|
|
|
TEMP=`mktemp -d /$TMPDIR/notary.XXXXXX`
|
2017-11-07 09:47:22 +01:00
|
|
|
git clone -b $VERSION https://github.com/theupdateframework/notary.git $TEMP
|
2017-09-26 11:14:13 +02:00
|
|
|
|
2018-10-17 10:04:14 +02:00
|
|
|
echo 'build the notary binary bases on the golang:1.9.4...'
|
2017-09-26 11:14:13 +02:00
|
|
|
cp binary.Dockerfile $TEMP
|
|
|
|
cd $TEMP
|
|
|
|
docker build -f binary.Dockerfile -t notary-golang $TEMP
|
2017-12-09 19:53:12 +01:00
|
|
|
cp -r $TEMP/migrations binary
|
2017-09-26 11:14:13 +02:00
|
|
|
|
|
|
|
echo 'copy the notary binary to local...'
|
|
|
|
ID=$(docker create notary-golang)
|
|
|
|
echo $ID
|
|
|
|
cd $cur
|
2018-08-27 09:52:09 +02:00
|
|
|
docker cp $ID:/go/bin/notary-server binary
|
|
|
|
docker cp $ID:/go/bin/notary-signer binary
|
2017-09-26 11:14:13 +02:00
|
|
|
|
|
|
|
docker rm -f $ID
|
|
|
|
docker rmi -f notary-golang
|
|
|
|
|
2017-12-09 19:53:12 +01:00
|
|
|
rm -rf $TEMP
|
|
|
|
|
2017-09-26 11:14:13 +02:00
|
|
|
|