Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
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
李丛阳
education
Commits
da253db7
Commit
da253db7
authored
Jan 19, 2018
by
李丛阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apache
parent
ad8204f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
11 deletions
+26
-11
BCodeLxcServiceImpl.java
...soft/business/bcode/service/impl/BCodeLxcServiceImpl.java
+6
-2
Global.java
src/main/java/org/rcisoft/common/component/Global.java
+5
-0
LxcCommand.java
src/main/java/org/rcisoft/core/command/LxcCommand.java
+9
-5
application-dev.yml
src/main/resources/application-dev.yml
+1
-0
application-prod.yml
src/main/resources/application-prod.yml
+4
-3
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeLxcServiceImpl.java
View file @
da253db7
...
@@ -82,8 +82,12 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
...
@@ -82,8 +82,12 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
result
=
new
CommandResult
(
ResultCode
.
FAIL
,
"容器配置文件有误!"
,
lxc
);
result
=
new
CommandResult
(
ResultCode
.
FAIL
,
"容器配置文件有误!"
,
lxc
);
return
result
;
return
result
;
}
}
/*启动路径*/
String
dockerPath
=
global
.
getPHYSICAL_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getLxcDockerfilePath
()
+
File
.
separator
+
lxc
.
getUserId
()
+
File
.
separator
;
/*2.docker-compose 起容器*/
/*2.docker-compose 起容器*/
result
=
lxcCommand
.
startOrDownLxc
(
destPath
);
log
.
info
(
"执行路径:{}"
,
dockerPath
);
result
=
lxcCommand
.
startOrDownLxc
(
dockerPath
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
result
=
new
CommandResult
(
ResultCode
.
FAIL
,
"容器启动失败!"
,
lxc
);
result
=
new
CommandResult
(
ResultCode
.
FAIL
,
"容器启动失败!"
,
lxc
);
return
result
;
return
result
;
...
@@ -103,7 +107,7 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
...
@@ -103,7 +107,7 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
Map
jobParam
=
new
HashMap
();
Map
jobParam
=
new
HashMap
();
jobParam
.
put
(
"redisKeyId"
,
key
);
jobParam
.
put
(
"redisKeyId"
,
key
);
jobParam
.
put
(
"containerName"
,
this
.
getModelProject
(
lxc
.
getCode
())
+
"_"
+
lxc
.
getUserId
());
jobParam
.
put
(
"containerName"
,
this
.
getModelProject
(
lxc
.
getCode
())
+
"_"
+
lxc
.
getUserId
());
jobParam
.
put
(
"containerPath"
,
d
est
Path
);
jobParam
.
put
(
"containerPath"
,
d
ocker
Path
);
jobParam
.
put
(
"containerPort"
,
port
);
jobParam
.
put
(
"containerPort"
,
port
);
JobDetail
job
=
JobBuilder
.
newJob
(
StopLxcJob
.
class
).
JobDetail
job
=
JobBuilder
.
newJob
(
StopLxcJob
.
class
).
withIdentity
(
global
.
getLxcPrefix
()
+
lxc
.
getUserId
(),
JOB_LXC_GROUP
).
withIdentity
(
global
.
getLxcPrefix
()
+
lxc
.
getUserId
(),
JOB_LXC_GROUP
).
...
...
src/main/java/org/rcisoft/common/component/Global.java
View file @
da253db7
...
@@ -34,6 +34,11 @@ public class Global {
...
@@ -34,6 +34,11 @@ public class Global {
@Value
(
"${global.path.base_upload_server_location}"
)
@Value
(
"${global.path.base_upload_server_location}"
)
private
String
BASE_UPLOAD_SERVER_LOCATION
;
private
String
BASE_UPLOAD_SERVER_LOCATION
;
/*容器外路径*/
@Value
(
"${global.path.physical_upload_server_location}"
)
private
String
PHYSICAL_UPLOAD_SERVER_LOCATION
;
/*课程相关文件路径*/
/*课程相关文件路径*/
@Value
(
"${global.path.course_location}"
)
@Value
(
"${global.path.course_location}"
)
private
String
COURSE_LOCATION
;
private
String
COURSE_LOCATION
;
...
...
src/main/java/org/rcisoft/core/command/LxcCommand.java
View file @
da253db7
...
@@ -58,10 +58,12 @@ public class LxcCommand {
...
@@ -58,10 +58,12 @@ public class LxcCommand {
CommandResult
commandResult
=
null
;
CommandResult
commandResult
=
null
;
try
{
try
{
File
dirPath
=
new
File
(
dest
);
File
dirPath
=
new
File
(
dest
);
if
(!
dirPath
.
exists
()
||
!
dirPath
.
isDirectory
()){
if
(!
isRemote
)
{
log
.
error
(
"目录错误 ...."
+
dest
);
if
(!
dirPath
.
exists
()
||
!
dirPath
.
isDirectory
())
{
commandResult
=
new
CommandResult
(
ResultCode
.
FAIL
,
"目录不存在"
,
null
);
log
.
error
(
"目录错误 ...."
+
dest
);
return
commandResult
;
commandResult
=
new
CommandResult
(
ResultCode
.
FAIL
,
"目录不存在"
,
null
);
return
commandResult
;
}
}
}
if
(
isStart
)
if
(
isStart
)
if
(
isRemote
)
if
(
isRemote
)
...
@@ -73,7 +75,9 @@ public class LxcCommand {
...
@@ -73,7 +75,9 @@ public class LxcCommand {
remoteExecuteCommand
.
execute
(
DOWN_LXC_COMMAND
,
dest
);
remoteExecuteCommand
.
execute
(
DOWN_LXC_COMMAND
,
dest
);
else
else
Runtime
.
getRuntime
().
exec
(
"cd "
+
dest
+
" && "
+
DOWN_LXC_COMMAND
);
Runtime
.
getRuntime
().
exec
(
"cd "
+
dest
+
" && "
+
DOWN_LXC_COMMAND
);
dirPath
.
delete
();
if
(!
isRemote
)
{
dirPath
.
delete
();
}
}
}
commandResult
=
new
CommandResult
(
ResultCode
.
SUCCESS
,
null
,
null
);
commandResult
=
new
CommandResult
(
ResultCode
.
SUCCESS
,
null
,
null
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/resources/application-dev.yml
View file @
da253db7
...
@@ -105,6 +105,7 @@ global:
...
@@ -105,6 +105,7 @@ global:
max_password
:
16
max_password
:
16
path
:
path
:
base_upload_server_location
:
/working/resource/eduServer/
base_upload_server_location
:
/working/resource/eduServer/
physical_upload_server_location
:
/working/resource/eduServer
course_location
:
course
course_location
:
course
lesson_location
:
lesson
lesson_location
:
lesson
sl_location
:
sl
sl_location
:
sl
...
...
src/main/resources/application-prod.yml
View file @
da253db7
...
@@ -55,7 +55,7 @@ spring:
...
@@ -55,7 +55,7 @@ spring:
add-mappings
:
false
add-mappings
:
false
redis
:
redis
:
host
:
106.2.3.134
host
:
106.2.3.134
port
:
748
1
port
:
748
2
pool
:
pool
:
max-idle
:
50
max-idle
:
50
max-active
:
1000
max-active
:
1000
...
@@ -105,6 +105,7 @@ global:
...
@@ -105,6 +105,7 @@ global:
max_password
:
16
max_password
:
16
path
:
path
:
base_upload_server_location
:
/working/resource/eduServer/
base_upload_server_location
:
/working/resource/eduServer/
physical_upload_server_location
:
/working/dockervolume/edu2_data_ubuntu/eduServer
course_location
:
course
course_location
:
course
lesson_location
:
lesson
lesson_location
:
lesson
sl_location
:
sl
sl_location
:
sl
...
@@ -141,6 +142,6 @@ global:
...
@@ -141,6 +142,6 @@ global:
html_project
:
'
1002'
html_project
:
'
1002'
serverLxc
:
serverLxc
:
ip
:
1
92.168.1.130
ip
:
1
06.2.3.134
username
:
root
username
:
root
password
:
123456
password
:
91isoft_xunda
\ No newline at end of file
\ No newline at end of file
src/main/resources/application.yml
View file @
da253db7
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
prod
\ No newline at end of file
\ No newline at end of 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