forked from vga101/meshcommander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·31 lines (25 loc) · 900 Bytes
/
build.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
#!/bin/sh
user=vga101
imagename=meshcommander
# build
docker pull node:latest
docker build --no-cache=true -t $user/$imagename:lastbuilt ./ | tee build.out
# get npm-installed version
version=$( grep -E "^Meshcommander version: " build.out | awk '{ print $3 }' | sed "s/-//" )
if [ -z "$version" ] ; then
echo "Could not grep installed version. Exit."
exit 1
fi
# append my version number
version="v$version-p0"
# tag
echo "Tagging lastbuilt as $user/$imagename:$version"
docker tag $user/$imagename:lastbuilt $user/$imagename:$version
# hint
echo
echo "* Run it with"
echo " docker run -d -p 127.0.0.1:3000:3000 --name meshcommander vga101/meshcommander:lastbuilt"
echo "* If it behaves well, push with the following commands:"
echo " docker push $user/$imagename:$version"
echo " docker tag $user/$imagename:$version $user/$imagename:latest"
echo " docker push $user/$imagename:latest"