Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
windows
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanhai
windows
Commits
2ca3bf0d
Commit
2ca3bf0d
authored
Oct 19, 2023
by
liuzicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化项目
parent
b4f70beb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
189 additions
and
1 deletion
+189
-1
Jenkinsfile
Jenkinsfile
+75
-0
Jenkinsfile-prod
Jenkinsfile-prod
+72
-0
Dockerfile
docker/Dockerfile
+13
-0
entrypoint.sh
docker/entrypoint.sh
+2
-0
pom.xml
pom.xml
+25
-0
RouterConfig.java
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
+1
-0
bootstrap.yml
src/main/resources/bootstrap.yml
+1
-1
No files found.
Jenkinsfile
0 → 100644
View file @
2ca3bf0d
pipeline
{
agent
any
environment
{
CREDENTIALS_ID
=
"jqtx-git"
APPLICATION_URL
=
"ssh://git@gitlab.jqtianxia.cn:2222/zhanhai/windows.git"
APPLICATION_NAME
=
'windows'
APPLICATION_PORT
=
'8432'
ENV_NAME
=
"test"
APPLICATION_SERVER_NAME
=
'test-portal'
DOCKER_REGISTER
=
'docker-rep-registry-vpc.cn-hangzhou.cr.aliyuncs.com'
HARBOR_PROJECT
=
'loan'
HARBOR_USER
=
'BlackJoker@1907867481722754'
HARBOR_PASSWORD
=
'EYzYqxMZYfEwBB6Z'
XXL_PORT
=
'5265'
}
stages
{
stage
(
"Env Variables"
)
{
steps
{
sh
"printenv"
}
}
stage
(
"拉取代码"
){
steps
{
script
{
env
.
VERSION
=
"${env.GIT_COMMIT}"
.
substring
(
0
,
8
)
env
.
PORT
=
"${env.APPLICATION_PORT}"
env
.
DOCKER_IMAGES_NAME
=
"${env.APPLICATION_NAME}-${env.ENV_NAME}-${env.VERSION}"
checkout
([
$class
:
'GitSCM'
,
branches:
[[
name:
"${GIT_BRANCH}"
]],
doGenerateSubmoduleConfigurations:
false
,
extensions:
[],
submoduleCfg:
[],
userRemoteConfigs:
[[
credentialsId:
"${CREDENTIALS_ID}"
,
url:
"${APPLICATION_URL}"
]]])
sh
"echo BRANCH is : ${env.GIT_BRANCH}"
sh
"echo Build Version : ${env.VERSION}"
sh
"echo Env name is : ${env.ENV_NAME}"
sh
"echo Port is : ${env.PORT}"
sh
"echo Image name is : ${env.DOCKER_IMAGES_NAME}"
}
}
}
stage
(
'构建'
){
steps
{
sh
"/opt/apache-maven-3.8.1/bin/mvn clean package -DskipTests=true docker:build"
}
}
stage
(
"发布镜像"
)
{
steps
{
script
{
sh
"docker login -u ${env.HARBOR_USER} -p ${env.HARBOR_PASSWORD} ${env.DOCKER_REGISTER}"
env
.
DOCKER_IMAGES_NAME
=
"${env.DOCKER_REGISTER}/${env.HARBOR_PROJECT}/${APPLICATION_NAME}:${env.VERSION}"
sh
"docker tag ${env.APPLICATION_NAME} ${env.DOCKER_IMAGES_NAME}"
sh
"docker push ${env.DOCKER_IMAGES_NAME}"
sh
"docker rmi ${env.APPLICATION_NAME}:latest"
}
}
}
stage
(
"推送远程服务器"
)
{
steps
{
script
{
def
list
=
env
.
APPLICATION_SERVER_NAME
.
split
(
','
)
for
(
i
in
list
){
println
"启动参数 ${DOCKER_REGISTER} ${HARBOR_PROJECT} ${APPLICATION_NAME} ${VERSION} ${APPLICATION_PORT} ${XXL_PORT}"
println
"${i}"
sshPublisher
(
publishers:
[
sshPublisherDesc
(
configName:
i
,
transfers:
[
sshTransfer
(
cleanRemote:
false
,
excludes:
''
,
execCommand:
"sh /root/themis/docker.sh ${DOCKER_REGISTER} ${HARBOR_PROJECT} ${APPLICATION_NAME} ${VERSION} ${APPLICATION_PORT} ${XXL_PORT}"
,
execTimeout:
0
,
flatten:
false
,
makeEmptyDirs:
false
,
noDefaultExcludes:
false
,
patternSeparator:
'[, ]+'
,
remoteDirectory:
'*'
,
remoteDirectorySDF:
false
,
removePrefix:
''
,
sourceFiles:
'/root/themis/dd'
)],
usePromotionTimestamp:
false
,
useWorkspaceInPromotion:
false
,
verbose:
false
)])
}
}
}
}
}
}
\ No newline at end of file
Jenkinsfile-prod
0 → 100644
View file @
2ca3bf0d
pipeline
{
agent any
environment {
CREDENTIALS_ID ="jqtx-git"
APPLICATION_URL="ssh://git@gitlab.jqtianxia.cn:2222/zhanhai/themis.git"
APPLICATION_NAME = 'themis'
APPLICATION_PORT = '8199'
ENV_NAME = "prod"
APPLICATION_SERVER_NAME='datagateway-1'
DOCKER_REGISTER = 'docker-rep-registry-vpc.cn-hangzhou.cr.aliyuncs.com'
HARBOR_PROJECT ='prod'
HARBOR_USER='BlackJoker@1907867481722754'
HARBOR_PASSWORD='EYzYqxMZYfEwBB6Z'
XXL_PORT= '5265'
}
stages {
stage("Env Variables") {
steps {
sh "printenv"
}
}
stage ("拉取代码"){
steps{
script {
env.VERSION="${env.GIT_COMMIT}".substring(0,8)
env.PORT = "${env.APPLICATION_PORT}"
checkout([$class: 'GitSCM', branches: [[name: "${GIT_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId:"${CREDENTIALS_ID}", url: "${APPLICATION_URL}"]]])
sh "echo BRANCH is : ${env.GIT_BRANCH}"
sh "echo Build Version : ${env.VERSION}"
sh "echo Env name is : ${env.ENV_NAME}"
sh "echo Port is : ${env.PORT}"
}
}
}
stage ('构建'){
steps {
sh "/opt/apache-maven-3.8.1/bin/mvn clean package -DskipTests=true docker:build"
}
}
stage("发布镜像") {
steps {
script{
sh "docker login -u ${env.HARBOR_USER} -p ${env.HARBOR_PASSWORD} ${env.DOCKER_REGISTER}"
env.DOCKER_IMAGES_NAME = "${env.DOCKER_REGISTER}/${env.HARBOR_PROJECT}/${APPLICATION_NAME}:${env.VERSION}"
sh "docker tag ${env.APPLICATION_NAME} ${env.DOCKER_IMAGES_NAME}"
sh "docker push ${env.DOCKER_IMAGES_NAME}"
sh "docker rmi ${env.APPLICATION_NAME}:latest"
}
}
}
stage("推送远程服务器") {
steps {
script{
def list=env.APPLICATION_SERVER_NAME.split(',')
for(i in list ){
println "启动参数 ${DOCKER_REGISTER} ${HARBOR_PROJECT} ${APPLICATION_NAME} ${VERSION} ${APPLICATION_PORT} ${XXL_PORT}"
println "${i}"
// 生产环境禁用 sshPublisher(publishers: [sshPublisherDesc(configName: i, transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: "sh /root/coeus/docker.sh ${DOCKER_REGISTER} ${HARBOR_PROJECT} ${APPLICATION_NAME} ${VERSION} ${APPLICATION_PORT} ${XXL_PORT}", execTimeout: 0, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '*', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '/root/coeus/dd')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}
}
}
docker/Dockerfile
0 → 100644
View file @
2ca3bf0d
FROM
java:8
ENV
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JAVA_OPTS="" \
SPRING_OPTS="" \
TZ="Asia/Shanghai"
RUN
mkdir
-p
/home/jqtx/
&&
mkdir
-p
/data/xxl/logs
WORKDIR
/home/jqtx
ADD
entrypoint.sh entrypoint.sh
RUN
chmod
775 entrypoint.sh
ADD
*windows*.jar app.jar
ENTRYPOINT
["./entrypoint.sh"]
EXPOSE
8080
EXPOSE
8719
\ No newline at end of file
docker/entrypoint.sh
0 → 100644
View file @
2ca3bf0d
#!/bin/sh
exec
java
${
JAVA_OPTS
}
-jar
"/home/jqtx/app.jar"
${
SPRING_OPTS
}
"
$@
"
pom.xml
View file @
2ca3bf0d
...
...
@@ -183,6 +183,31 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<version>
1.0.0
</version>
<!--docker镜像相关的配置信息-->
<configuration>
<!--镜像名,这里用工程名-->
<imageName>
${project.artifactId}
</imageName>
<!--Dockerfile文件所在目录-->
<dockerDirectory>
${project.basedir}/docker
</dockerDirectory>
<!--TAG,这里用工程版本号-->
<imageTags>
<imageTag>
latest
</imageTag>
</imageTags>
<!--<buildArgs>target/</buildArgs>-->
<!--构建镜像的配置信息-->
<resources>
<resource>
<targetPath>
/
</targetPath>
<directory>
${project.build.directory}
</directory>
<include>
${project.build.finalName}.jar
</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
...
...
src/main/java/com/jqtx/windows/web/config/RouterConfig.java
View file @
2ca3bf0d
...
...
@@ -21,6 +21,7 @@ public class RouterConfig implements CommandLineRunner {
private
CreditSubmitCommand
creditSubmitCommand
;
@Autowired
private
LoanSubmitCommand
loanSubmitCommand
;
@Autowired
private
LoanStatusCommand
loanStatusCommand
;
@Autowired
...
...
src/main/resources/bootstrap.yml
View file @
2ca3bf0d
...
...
@@ -3,7 +3,7 @@ nacos:
logstash
:
address
:
47.110.231.217:5000
server
:
port
:
8
432
port
:
8
080
spring
:
application
:
name
:
service-windows
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment