Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
08d4161cad | ||
c85e76cc26 |
@ -3,7 +3,7 @@ type: docker
|
|||||||
name: jar-deploy
|
name: jar-deploy
|
||||||
trigger:
|
trigger:
|
||||||
event: [ push ]
|
event: [ push ]
|
||||||
branch: [ main ]
|
branch: [ master ]
|
||||||
steps:
|
steps:
|
||||||
- name: build-package
|
- name: build-package
|
||||||
image: maven:3.8-openjdk-8
|
image: maven:3.8-openjdk-8
|
||||||
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM openjdk:8
|
||||||
|
VOLUME /tmp
|
||||||
|
ADD scenic-1.0-SNAPSHOT.jar app.jar
|
||||||
|
EXPOSE 8081
|
||||||
|
ENTRYPOINT ["java","-jar","app.jar"]
|
24
run.sh
Normal file
24
run.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# 定义应用组名
|
||||||
|
group_name='xyy'
|
||||||
|
# 定义应用名称
|
||||||
|
app_name='init'
|
||||||
|
# 定义应用版本
|
||||||
|
app_version='latest'
|
||||||
|
# 定义应用环境
|
||||||
|
profile_active='dev'
|
||||||
|
echo '----copy jar----'
|
||||||
|
docker stop ${app_name}
|
||||||
|
echo '----stop container----'
|
||||||
|
docker rm ${app_name}
|
||||||
|
echo '----rm container----'
|
||||||
|
docker rmi ${group_name}/${app_name}:${app_version}
|
||||||
|
echo '----rm image----'
|
||||||
|
# 打包编译docker镜像
|
||||||
|
docker build -t ${group_name}/${app_name}:${app_version} .
|
||||||
|
echo '----build image----'
|
||||||
|
docker run -p 0504:8081 --name ${app_name} \
|
||||||
|
-e TZ="Asia/Shanghai" \
|
||||||
|
-v /etc/localtime:/etc/localtime \
|
||||||
|
-d ${group_name}/${app_name}:${app_version}
|
||||||
|
echo '----start container----'
|
Loading…
Reference in New Issue
Block a user