Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정민우
/
vps_service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
정민우
2021-06-11 03:29:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c9e14982f37b3989f5356f308fd1a23999652c7
8c9e1498
1 parent
08dde729
[Add] dockerfile Admin 추가
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
backend/controllers/dockerController.js
backend/test/dockertest.js
backend/controllers/dockerController.js
View file @
8c9e149
...
...
@@ -170,7 +170,31 @@ exports.adminListDockerfile = async (req, res) => {
}
}
exports
.
adminDeleteDockerfile
=
async
(
req
,
res
)
=>
{
const
requiredKey
=
[
'id'
]
const
required
=
checkRequiredExist
(
req
.
body
,
requiredKey
)
if
(
required
)
{
logging
(
'dockerfile'
,
'error'
,
{
code
:
400
,
message
:
'missingKey:${required}'
},
req
)
return
sendError
(
res
,
400
,
`missingKey:
${
required
}
`
)
}
try
{
const
dockerfileId
=
req
.
body
.
id
let
dockerfile
=
await
Dockerfile
.
findByPk
(
dockerfileId
)
if
(
!
dockerfile
)
{
logging
(
'dockerfile'
,
'error'
,
{
code
:
404
,
message
:
'NoDockerfileFound'
},
req
)
return
sendError
(
res
,
404
,
'NoDockerfileFound'
)
}
await
Dockerfile
.
destroy
({
where
:
{
id
:
dockerfile
.
id
}
})
logging
(
'dockerfile'
,
'delete'
,
null
,
req
)
return
sendResponse
(
res
,
true
,
201
)
}
catch
(
error
)
{
logging
(
'dockerfile'
,
'error'
,
{
code
:
500
,
message
:
error
.
message
},
req
)
return
sendError
(
res
,
500
,
error
.
message
)
}
}
exports
.
adminListImage
=
async
(
req
,
res
)
=>
{
...
...
backend/test/dockertest.js
deleted
100644 → 0
View file @
08dde72
var
Docker
=
require
(
'dockerode'
)
var
docker
=
new
Docker
({
socketPath
:
'/var/run/docker.sock'
})
docker
.
buildImage
({
context
:
'../dockerfiles/sk2jsif92jajsdi1'
,
src
:
[
'Dockerfile'
]
},
{
t
:
'testimage1337'
},
function
(
err
,
response
)
{
console
.
log
(
response
)
})
Please
register
or
login
to post a comment