SpringBoot actual electricity supplier item mall (25k + star) Address: github.com/macrozheng/...
Summary
This article is mall
the exclusive method Jenkins automated deployment projects.
The basic use of Jenkins
Basic use on Jenkins can refer to: use a key package Jenkins deploy SpringBoot application, it is so 6!
Execute scripts ready
First, we first need to remotely execute scripts ready.
-
Script files are stored in the
mall
project/document/sh
directory: -
Before uploading the script to modify all script files in the IDEA line breaks format
LF
, or the script will not be executed;
- Upload all script files to a specified directory, where we upload to the
/mydata/sh
directory;
- All script files are modified executable file:
chmod +x ./mall-*
复制代码
Jenkins created the task
Next we will be achieved by creating automated deployment tasks in Jenkins. Because we
mall
are a multi-module project, and once deployed above the single-module project or differentiated.
mall-admin
Because creating each module to perform tasks are similar, the following will explain in detail to create a mall-admin task module, other modules will briefly explain.
- First we select the
构建一个自由风格的软件项目
mall-admin, then configure Git repository address, here I am directly using Gitee above address:
- Then we create a build, build
mall
the project dependencies module, otherwise they will because they can not find these modules fails to build when building a service module that can run;
# 只install mall-common,mall-mbg,mall-security三个模块
clean install -pl mall-common,mall-mbg,mall-security -am
复制代码
- Reliance Scheme for construction of the project:
- Then create one construct, and build separately packaged mall-admin module:
- Add a remote SSH tasks, run the script to execute the mall-admin:
- Click Save to complete the mission to create a mall-admin.
mall-portal
mall-portal and other modules to create a mall-admin tasks basically the same way, simply modify the pom.xml file location to location and execute scripts when building blocks.
- We can be copied directly from the task mall-admin modules over a creation:
- The second modification pom.xml file in the build position, read: $ {WORKSPACE} /mall-portal/pom.xml
- The third modification SSH script file is executed in the position to build, read: /mydata/sh/mall-portal.sh
- Click Save to complete the tasks mall-portal creation.
mall-search
Reference to create a mall-admin and mall-portal of.
Tasks created
project address
the public
mall project a full tutorial serialized in public concern number the first time to obtain.