espid2sensor/build_and_copy.sh entfernen
Ueberfluessig, seit deploy.sh direkt ueber docker build + push arbeitet (wie bei den anderen Services) statt ueber das alte scp-basierte Kopieren auf einen Zielhost. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,63 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Build Docker-Container
|
|
||||||
#
|
|
||||||
# Call: buildit.sh name [target]
|
|
||||||
#
|
|
||||||
# The Dockerfile must be named like Dockerfile_name
|
|
||||||
#
|
|
||||||
# 2018-09-20 rxf
|
|
||||||
# - before sending docker image to remote, tag actual remote image
|
|
||||||
#
|
|
||||||
# 2018-09-14 rxf
|
|
||||||
# - first Version
|
|
||||||
#
|
|
||||||
|
|
||||||
set -x
|
|
||||||
port=""
|
|
||||||
orgName=esp2sensor
|
|
||||||
name=esp2sensor
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
echo "Usage build_and_copy.sh [-p port] [-n name] target"
|
|
||||||
echo " Build docker container $name and copy to target"
|
|
||||||
echo "Params:"
|
|
||||||
echo " target: Where to copy the container to "
|
|
||||||
echo " -p port: ssh port (default 22)"
|
|
||||||
echo " -n name: new name for container (default: $orgName)"
|
|
||||||
}
|
|
||||||
|
|
||||||
while getopts n:p:h? o
|
|
||||||
do
|
|
||||||
case "$o" in
|
|
||||||
n) name="$OPTARG";;
|
|
||||||
p) port="-p $OPTARG";;
|
|
||||||
h) usage; exit 0;;
|
|
||||||
*) usage; exit 1;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
if [[ -z "$target" ]]; then
|
|
||||||
target=$1
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "bad option $1"
|
|
||||||
# exit 1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
docker build -f Dockerfile_$orgName --no-cache -t $name .
|
|
||||||
|
|
||||||
dat=`date +%Y%m%d%H%M`
|
|
||||||
|
|
||||||
if [ "$target" == "localhost" ]
|
|
||||||
then
|
|
||||||
docker tag $name $name:V_$dat
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
ssh $port $target "docker tag $name $name:V_$dat"
|
|
||||||
docker save $name | bzip2 | pv | ssh $port $target 'bunzip2 | docker load'
|
|
||||||
Reference in New Issue
Block a user