Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-devlop-rest-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhouzihao
node-devlop-rest-api
Commits
e27ddcba
Commit
e27ddcba
authored
Apr 03, 2020
by
zhouzihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev-添加项目源数据的额外参数
parent
aceacc36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
+47
-5
ci
ci
+28
-5
docker
docker
+10
-0
shell/java.js
shell/java.js
+9
-0
No files found.
ci
View file @
e27ddcba
...
@@ -3,6 +3,8 @@ stages:
...
@@ -3,6 +3,8 @@ stages:
- javacheck
- javacheck
- builddocker
- builddocker
- dockercheck
- dockercheck
- dockerdeploy
- deploycheck
- cus
- cus
variables:
variables:
...
@@ -21,7 +23,7 @@ buildjava:
...
@@ -21,7 +23,7 @@ buildjava:
tags:
tags:
- share
- share
only:
only:
- /^
(r|t)-([0-9]+).([0-9]+).([0-9]+)
/
- /^
v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+
/
javacheck:
javacheck:
image: curlimages/curl
image: curlimages/curl
...
@@ -32,7 +34,7 @@ javacheck:
...
@@ -32,7 +34,7 @@ javacheck:
tags:
tags:
- share
- share
only:
only:
- /^
(r|t)-([0-9]+).([0-9]+).([0-9]+)
/
- /^
v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+
/
dockercheck:
dockercheck:
image: curlimages/curl
image: curlimages/curl
...
@@ -43,7 +45,7 @@ dockercheck:
...
@@ -43,7 +45,7 @@ dockercheck:
tags:
tags:
- share
- share
only:
only:
- /^
(r|t)-([0-9]+).([0-9]+).([0-9]+)
/
- /^
v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+
/
builddocker:
builddocker:
stage: builddocker
stage: builddocker
...
@@ -57,7 +59,28 @@ builddocker:
...
@@ -57,7 +59,28 @@ builddocker:
tags:
tags:
- share
- share
only:
only:
- /^(r|t)-([0-9]+).([0-9]+).([0-9]+)/
- /^v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+/
dockerdeploy:
stage: dockerdeploy
script:
- echo "deploy!"
{deploy_str}
tags:
- {tag}
only:
- /^v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+/
deploycheck:
image: curlimages/curl
stage: deploycheck
script:
{fail_str}
when: on_failure
tags:
- share
only:
- /^v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+/
sucback:
sucback:
stage: cus
stage: cus
...
@@ -67,4 +90,4 @@ sucback:
...
@@ -67,4 +90,4 @@ sucback:
tags:
tags:
- share
- share
only:
only:
- /^(r|t)-([0-9]+).([0-9]+).([0-9]+)/
- /^v-([0-9]+).([0-9]+).([0-9]+)-([0-9])+/
\ No newline at end of file
\ No newline at end of file
docker
0 → 100644
View file @
e27ddcba
FROM 10.100.9.22:2080/public/openjdk8-jdk-alpine:latest
ARG RUNPRO
VOLUME /tmp
VOLUME /opt/logs
WORKDIR /opt/
{docker-file-str}
COPY {service}/target/{service-exec}.jar {service}.jar
ENTRYPOINT ["java","-jar","{service}.jar","--spring.profiles.active=${RUNPRO}"]
\ No newline at end of file
shell/java.js
View file @
e27ddcba
...
@@ -138,6 +138,8 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
...
@@ -138,6 +138,8 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
//构建项目的服务名
//构建项目的服务名
var
deploy_name
=
""
;
var
deploy_name
=
""
;
let
docker_file_str
=
""
if
(
_
.
isString
(
v
))
{
if
(
_
.
isString
(
v
))
{
module_name
=
v
;
module_name
=
v
;
opt
=
{
filePath
:
project_dir
+
"
/
"
+
v
+
"
/pom.xml
"
}
opt
=
{
filePath
:
project_dir
+
"
/
"
+
v
+
"
/pom.xml
"
}
...
@@ -148,6 +150,12 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
...
@@ -148,6 +150,12 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
throw
new
Error
(
"
错误的类型
"
)
throw
new
Error
(
"
错误的类型
"
)
}
}
// 读取项目源数据的的dockerfile的额外配置
if
(
_
.
isObject
(
v
)
&&
_
.
has
(
v
,
"
docker-file-str
"
))
{
// fixme need keep dangerous command away~
docker_file_str
=
_
.
get
(
v
,
"
docker-file-str
"
);
}
deploy_name
=
envObj
.
name
+
"
-
"
+
module_name
;
deploy_name
=
envObj
.
name
+
"
-
"
+
module_name
;
if
(
_
.
isObject
(
v
)
&&
_
.
has
(
v
,
`deploy.
${
envObj
.
name
}
`
))
{
if
(
_
.
isObject
(
v
)
&&
_
.
has
(
v
,
`deploy.
${
envObj
.
name
}
`
))
{
deploy_name
=
_
.
get
(
v
,
`deploy.
${
envObj
.
name
}
`
);
deploy_name
=
_
.
get
(
v
,
`deploy.
${
envObj
.
name
}
`
);
...
@@ -182,6 +190,7 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
...
@@ -182,6 +190,7 @@ const buildJava = async (projectObj, envObj, typeObj, configList, branch, versio
fs
.
writeFileSync
(
`
${
project_dir
}
/
${
dockerfile_name
}
`
,
typeObj
.
docker_file
);
fs
.
writeFileSync
(
`
${
project_dir
}
/
${
dockerfile_name
}
`
,
typeObj
.
docker_file
);
var
dockerfile_map
=
{
var
dockerfile_map
=
{
"
{docker-file-str}
"
:
docker_file_str
,
"
{service}
"
:
module_name
,
"
{service}
"
:
module_name
,
"
{service-exec}
"
:
exec_file
"
{service-exec}
"
:
exec_file
}
}
...
...
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