Skip to content

Commit 6cbaa7f

Browse files
Merge pull request #41 from geekidea/dev
💻 1.2.3.RELEASE CentOS快速安装项目运行环境,快速构建/运维部署/启动项目
2 parents 956a5f7 + 8152a3a commit 6cbaa7f

File tree

6 files changed

+112
-7
lines changed

6 files changed

+112
-7
lines changed

deploy/deploy.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,69 @@
11
#! /bin/shell
22

3+
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#======================================================================
18+
# 1. 下载或更新spring-boot-plus版本库
19+
# 2. maven打包
20+
# 3. 运行spring-boot-plus
21+
# 4. 访问项目
22+
# author: geekidea
23+
# date: 2019-9-6
24+
#======================================================================
25+
26+
# 版本库路径
27+
PROJECT_REPO="https://github.com/geekidea/spring-boot-plus.git"
28+
# 项目名称
29+
PROJECT_NAME="spring-boot-plus"
30+
# 当前时间
31+
NOW=$(date --date='0 days ago' "+%Y-%m-%d-%H-%M-%S")
32+
echo "${NOW}"
33+
34+
# 1. 下载或更新spring-boot-plus版本库
35+
# 先判断当前目录下是否有spring-boot-plus目录
36+
# 如果有,则执行git pull
37+
# 如果没有,则clone
38+
if [ ! -d "/spring-boot-plus" ]; then
39+
git clone ${PROJECT_REPO}
40+
else
41+
git pull
42+
fi
43+
44+
# 2. maven打包
45+
cd $(PROJECT_NAME)
46+
mvn clean package -Ptest
47+
48+
# 3. 停服
49+
# cd到项目源代码同级目录
50+
cd ../
51+
# 停服
52+
sh ${PROJECT_NAME}-server/bin/shutdown.sh
53+
54+
# 4. 移动spring-boot-plus-server-assembly.tar.gz到项目同级目录下
55+
# 备份上一次的server
56+
echo "${NOW}"
57+
mv ${PROJECT_NAME}-server ${PROJECT_NAME}-server-"${NOW}"
58+
# 移动最新打包的server到项目同级目录下
59+
mv ${PROJECT_NAME}/target/${PROJECT_NAME}-server-assembly.tar.gz ../../
60+
61+
# 5. 运行spring-boot-plus
62+
tar -zxvf ${PROJECT_NAME}-server-assembly.tar.gz
63+
cd ${PROJECT_NAME}-server/bin
64+
sh restart.sh
65+
66+
# 6. 访问项目
67+
# 输出项目日志
68+
# http://localhost:8888/docs
69+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/shell
2+
3+
# Copyright 2019-2029 geekidea(https://github.com/geekidea)
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#======================================================================
18+
# 先下载按照脚本,多次执行该脚本,会覆盖以下下载的文件
19+
# 快速安装jdk/git/maven/redis/mysql
20+
#
21+
# author: geekidea
22+
# date: 2019-8-29
23+
#======================================================================
24+
25+
26+
wget -O install-all.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-all.sh
27+
wget -O install-jdk.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-jdk.sh
28+
wget -O install-git.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-git.sh
29+
wget -O install-maven.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-maven.sh
30+
wget -O install-redis.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-redis.sh
31+
wget -O install-mysql.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/install-mysql.sh
32+
33+
sh install-all.sh

docs/bin/install/install-mysql.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ echo "${PWD}"
5656
# 登陆
5757
mysql -uroot -p${PWD}
5858

59+
# 进入到mysql命令行时,修改密码
5960
# 修改密码
60-
# ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
61-
61+
# ALTER USER 'root'@'localhost' IDENTIFIED BY 'Springbootplus666!';
6262

63+
# 使用新密码登陆
64+
# exit
65+
# mysql -uroot -pSpringbootplus666!

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<groupId>io.geekidea</groupId>
2323
<artifactId>spring-boot-plus</artifactId>
24-
<version>1.2.2.RELEASE</version>
24+
<version>1.2.3.RELEASE</version>
2525
<packaging>jar</packaging>
2626

2727
<name>spring-boot-plus</name>
@@ -339,6 +339,7 @@
339339
<artifactId>maven-assembly-plugin</artifactId>
340340
<version>3.1.0</version>
341341
<configuration>
342+
<finalName>${project.build.finalName}-server</finalName>
342343
<descriptors>
343344
<descriptor>src/main/assembly/assembly.xml</descriptor>
344345
</descriptors>

src/main/assembly/assembly.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818
<assembly>
1919
<!-- 可自定义,这里指定的是项目环境 -->
20-
<!-- spring-boot-plus-1.0.1-RELEASE-local.tar.gz -->
21-
<id>${project.version}-${profileActive}</id>
20+
<!-- spring-boot-plus-server-1.0.1-RELEASE-local.tar.gz -->
21+
<!-- <id>${project.version}-${profileActive}</id> -->
22+
<id>assembly</id>
2223

2324
<!-- 打包的类型,如果有N个,将会打N个类型的包 -->
2425
<formats>
2526
<format>tar.gz</format>
26-
<format>zip</format>
27+
<!-- <format>zip</format> -->
2728
</formats>
2829

2930
<includeBaseDirectory>true</includeBaseDirectory>

src/main/resources/config/application-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spring:
1717
datasource:
1818
url: jdbc:mysql://localhost:3306/spring_boot_plus?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
1919
username: root
20-
password: root
20+
password: Springbootplus666!
2121

2222
# Redis配置
2323
redis:

0 commit comments

Comments
 (0)