-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·35 lines (25 loc) · 862 Bytes
/
deploy.sh
File metadata and controls
executable file
·35 lines (25 loc) · 862 Bytes
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
#!/bin/bash
# Installing Golang dependencies
dep ensure -update
# Installing ui dependencies
cd ./ui && npm install --registry=https://registry.npm.taobao.org
# Building ui resources
npm run gulp build-prod && cd ..
# Embedding static files
go generate ./app
# Building an executable binary file
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./dist/squirrel
# Building docker image
docker build -t lavenderx/squirrel .
containerName=squirrel-demo
isRunning=$(docker inspect --format="{{ .State.Running }}" ${containerName} 2> /dev/null)
if [ $? -eq 1 ]; then
printf "No ${containerName} is running\n"
else
# Checking container running status
if [ "${isRunning}" = "true" ]; then
docker stop ${containerName}
fi
docker rm ${containerName}
fi
docker run --name ${containerName} --net host -d lavenderx/squirrel