This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
forked from nats-io/nats-streaming-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·43 lines (31 loc) · 1.63 KB
/
update.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
#!/bin/bash
set -e
if [ $# -eq 0 ] ; then
echo "Usage: ./update.sh <nats-io/nats-streaming-server tag or branch>"
exit
fi
VERSION=$1
# cd to the current directory so the script can be run from anywhere.
cd `dirname $0`
echo "Fetching and building nats-streaming-server $VERSION..."
# Create a tmp build directory.
TEMP=/tmp/nats-streaming.build
mkdir $TEMP
git clone -b $VERSION https://github.com/nats-io/nats-streaming-server $TEMP
docker build -t nats-streaming-builder $TEMP
# Create a dummy nats streaming builder container so we can run a cp against it.
ID=$(docker create nats-streaming-builder)
# Update the local binaries.
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/linux-amd64/nats-streaming-server amd64/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/linux-amd64/nats-streaming-server amd64-alpine/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/linux-arm6/nats-streaming-server arm32v6/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/linux-arm7/nats-streaming-server arm32v7/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/linux-arm64/nats-streaming-server arm64v8/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/win-amd64/nats-streaming-server.exe windows/nanoserver-1803/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/win-amd64/nats-streaming-server.exe windows/nanoserver-1809/
docker cp $ID:/go/src/github.com/nats-io/nats-streaming-server/pkg/win-amd64/nats-streaming-server.exe windows/windowsservercore/
# Cleanup.
rm -fr $TEMP
docker rm -f $ID
docker rmi nats-streaming-builder
echo "Done."