-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
48 lines (29 loc) · 930 Bytes
/
deploy.sh
File metadata and controls
48 lines (29 loc) · 930 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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Jenkins 에서 체크가 끝나면 해당 파일을 실행
container_name="ebkm";
repository="baugh248730/ebkm";
# 기존 컨테이너 정지 후 이미지 제거
echo "Container stop and remove";
# shellcheck disable=SC1007
container_id=$(docker ps -aqf "name= ${container_name}");
echo "Docker : container_id = ${container_id}";
echo "Container stop"
docker stop ${container_id}
docker rm ${container_id}
echo "Docker image remove"
docker rmi ${container_name}
cd proxy
echo "Run Nginx ..."
docker build -t nginx:test .
echo "Change dir ... "
cd ..
# gradle build
echo "DockerFile start... and"
docker build -t ebkm:latest .
echo "DockerFile clear !!!"
sudo cat my_password.txt | docker login --username baugh248730 --password wotjd@487
echo "Docker compose up start ... "
docker-compose up -d
#echo "image push to docker hub"
#docker tag ebkm baugh248730/ebkm:latest
#docker push ${repository}