-
Notifications
You must be signed in to change notification settings - Fork 50
/
deploy.sh
executable file
·29 lines (22 loc) · 806 Bytes
/
deploy.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
#!/bin/bash
# Can run this as to use the file generated from build.sh:
#
# env $(cat props.env | xargs) ./deploy.sh
#Fail on non-zero
set -e
# Host port mapping for deploy-app
hostport=8000
sudo docker tag ${DOCKER_USERNAME}/http-app:stable ${DOCKER_USERNAME}/http-app:latest
cmd="sudo docker tag ${DOCKER_USERNAME}/http-app:stable ${DOCKER_USERNAME}/http-app:$VERSION"
eval $cmd
# no git here yet
# sudo docker tag http-app/http-app:$(git describe)
# Remove existing deployed application
cid=$(sudo docker ps --filter="name=deploy-app" -q -a)
if [ ! -z "$cid" ]
then
sudo docker rm -f deploy-app
fi
sudo docker run -d --name deploy-app -p $hostport:8000 ${DOCKER_USERNAME}/http-app:latest
sudo docker ps |grep ${DOCKER_USERNAME}/http-app
sudo docker images |grep ${DOCKER_USERNAME}/http-app