Merge branch 'master' of http://117.72.202.202:3000/ALEX/alex-api
This commit is contained in:
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
@ -8,17 +8,39 @@ pipeline {
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Pre') {
|
||||
stage('Pull Code') {
|
||||
steps {
|
||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||
sh 'ssh alex@117.72.202.202 "bash /home/alex/alex-api/bin/pre-steps.sh"'
|
||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||
sh """
|
||||
ssh ${REMOTE_USER}@${REMOTE_HOST} '
|
||||
set -e
|
||||
cd ${REMOTE_DIR} || git clone git@117.72.202.202:ALEX/alex-api.git ${REMOTE_DIR}
|
||||
cd ${REMOTE_DIR}
|
||||
git pull origin master
|
||||
'
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Pre Steps') {
|
||||
steps {
|
||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||
sh "ssh ${REMOTE_USER}@${REMOTE_HOST} 'bash ${REMOTE_DIR}/bin/pre-steps.sh'"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'mvn clean package -DskipTests'
|
||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||
sh """
|
||||
ssh ${REMOTE_USER}@${REMOTE_HOST} '
|
||||
cd ${REMOTE_DIR}
|
||||
mvn clean package -DskipTests
|
||||
'
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,16 +48,15 @@ pipeline {
|
||||
steps {
|
||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||
sh """
|
||||
scp target/alex-api-0.0.1-SNAPSHOT.jar ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_DIR}/app/
|
||||
ssh ${REMOTE_USER}@${REMOTE_HOST} '
|
||||
cd ${REMOTE_DIR} &&
|
||||
sudo docker compose down &&
|
||||
sudo docker compose up -d --build
|
||||
'
|
||||
ssh ${REMOTE_USER}@${REMOTE_HOST} '
|
||||
cd ${REMOTE_DIR}
|
||||
sudo docker compose down
|
||||
sudo docker image prune -f
|
||||
sudo docker compose up -d --build
|
||||
'
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -3,7 +3,7 @@ server:
|
||||
port: 8888
|
||||
spring:
|
||||
profiles:
|
||||
active: dev # 默认激活开发环境
|
||||
active: test
|
||||
#配置mybatis
|
||||
mybatis:
|
||||
configuration:
|
||||
@ -38,4 +38,4 @@ logging:
|
||||
org:
|
||||
springframework:
|
||||
integration: DEBUG
|
||||
messaging: DEBUG
|
||||
messaging: DEBUG
|
||||
|
BIN
target/alex-api-0.0.1-SNAPSHOT.jar
Normal file
BIN
target/alex-api-0.0.1-SNAPSHOT.jar
Normal file
Binary file not shown.
BIN
target/alex-api-0.0.1-SNAPSHOT.jar.original
Normal file
BIN
target/alex-api-0.0.1-SNAPSHOT.jar.original
Normal file
Binary file not shown.
12
target/classes/application-dev.yml
Normal file
12
target/classes/application-dev.yml
Normal file
@ -0,0 +1,12 @@
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/test_alex?characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: ALEXzcz123456
|
||||
redis:
|
||||
host: localhost
|
||||
password: ALEXzcz123456
|
||||
port: 6379
|
||||
database: 0
|
12
target/classes/application-prod.yml
Normal file
12
target/classes/application-prod.yml
Normal file
@ -0,0 +1,12 @@
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://117.72.202.202:3306/test_alex?characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
username: alex
|
||||
password: ALEXzcz123456
|
||||
redis:
|
||||
host: 117.72.202.202
|
||||
password: ALEXzcz123456
|
||||
port: 6379
|
||||
database: 0
|
12
target/classes/application-test.yml
Normal file
12
target/classes/application-test.yml
Normal file
@ -0,0 +1,12 @@
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://117.72.202.202:3306/test_alex?characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
username: alex
|
||||
password: ALEXzcz123456
|
||||
redis:
|
||||
host: 117.72.202.202
|
||||
password: ALEXzcz123456
|
||||
port: 6379
|
||||
database: 0
|
41
target/classes/application.yml
Normal file
41
target/classes/application.yml
Normal file
@ -0,0 +1,41 @@
|
||||
server:
|
||||
address: 0.0.0.0
|
||||
port: 8888
|
||||
spring:
|
||||
profiles:
|
||||
active: test
|
||||
#配置mybatis
|
||||
mybatis:
|
||||
configuration:
|
||||
auto-mapping-behavior: full
|
||||
map-underscore-to-camel-case: true
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
type-aliases-package: com.anytrek.entity # 配置别名路径
|
||||
mapper-locations: classpath:mapper/*.xml # 配置 XML 文件位置
|
||||
#配置mybatis-plus
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
global-config:
|
||||
db-config:
|
||||
table-prefix: t_
|
||||
id-type: auto
|
||||
#配置分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
params: count=countSql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
#配置日志
|
||||
logging:
|
||||
level:
|
||||
root: INFO #根日志配置,整个应用程序的默认日志级别为 INFO
|
||||
com.anytrek: DEBUG #com.anytrek 包下的类的日志级别设置为 DEBUG
|
||||
org.apache.ibatis: INFO #MyBatis 日志级别设置为 INFO
|
||||
com.zaxxer.hikari: INFO #HikariCP 的日志级别设置为 INFO
|
||||
org.springframework.web.socket: DEBUG
|
||||
org.springframework.web.socket.server.support: DEBUG
|
||||
org:
|
||||
springframework:
|
||||
integration: DEBUG
|
||||
messaging: DEBUG
|
BIN
target/classes/com/ctgu/alexapi/AlexApiApplication.class
Normal file
BIN
target/classes/com/ctgu/alexapi/AlexApiApplication.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/config/RedisConfig.class
Normal file
BIN
target/classes/com/ctgu/alexapi/config/RedisConfig.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/controller/UsersController.class
Normal file
BIN
target/classes/com/ctgu/alexapi/controller/UsersController.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/entity/UsersEntity.class
Normal file
BIN
target/classes/com/ctgu/alexapi/entity/UsersEntity.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/mapper/UsersMapper.class
Normal file
BIN
target/classes/com/ctgu/alexapi/mapper/UsersMapper.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/service/UsersService.class
Normal file
BIN
target/classes/com/ctgu/alexapi/service/UsersService.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/utils/ApiResult.class
Normal file
BIN
target/classes/com/ctgu/alexapi/utils/ApiResult.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/utils/PageData.class
Normal file
BIN
target/classes/com/ctgu/alexapi/utils/PageData.class
Normal file
Binary file not shown.
BIN
target/classes/com/ctgu/alexapi/utils/Tools.class
Normal file
BIN
target/classes/com/ctgu/alexapi/utils/Tools.class
Normal file
Binary file not shown.
16
target/classes/mapper/UsersMapper.xml
Normal file
16
target/classes/mapper/UsersMapper.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ctgu.alexapi.mapper.UsersMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ctgu.alexapi.entity.UsersEntity">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="username" column="username" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,username,password
|
||||
</sql>
|
||||
</mapper>
|
3
target/maven-archiver/pom.properties
Normal file
3
target/maven-archiver/pom.properties
Normal file
@ -0,0 +1,3 @@
|
||||
artifactId=alex-api
|
||||
groupId=com.ctgu
|
||||
version=0.0.1-SNAPSHOT
|
@ -0,0 +1,12 @@
|
||||
com/ctgu/alexapi/utils/PageData.class
|
||||
com/ctgu/alexapi/utils/ApiResult$ApiResultBuilder.class
|
||||
com/ctgu/alexapi/controller/UsersController.class
|
||||
com/ctgu/alexapi/utils/ApiResult.class
|
||||
com/ctgu/alexapi/mapper/UsersMapper.class
|
||||
com/ctgu/alexapi/utils/PageData$PageDataBuilder.class
|
||||
com/ctgu/alexapi/AlexApiApplication.class
|
||||
com/ctgu/alexapi/service/impl/UsersServiceImpl.class
|
||||
com/ctgu/alexapi/utils/Tools.class
|
||||
com/ctgu/alexapi/service/UsersService.class
|
||||
com/ctgu/alexapi/config/RedisConfig.class
|
||||
com/ctgu/alexapi/entity/UsersEntity.class
|
@ -0,0 +1,10 @@
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/mapper/UsersMapper.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/entity/UsersEntity.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/utils/PageData.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/utils/ApiResult.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/utils/Tools.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/service/UsersService.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/config/RedisConfig.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/service/impl/UsersServiceImpl.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/AlexApiApplication.java
|
||||
/home/alex/alex-api/src/main/java/com/ctgu/alexapi/controller/UsersController.java
|
@ -0,0 +1 @@
|
||||
com/ctgu/alexapi/AlexApiApplicationTests.class
|
@ -0,0 +1 @@
|
||||
/home/alex/alex-api/src/test/java/com/ctgu/alexapi/AlexApiApplicationTests.java
|
Binary file not shown.
Reference in New Issue
Block a user