Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xanadu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
SYNERG
xanadu
Commits
c8823720
Commit
c8823720
authored
Jan 27, 2020
by
nilanjandaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed file paths
parent
1f5318fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
dispatcher/index.js
dispatcher/index.js
+4
-4
dispatcher/package.json
dispatcher/package.json
+1
-0
No files found.
dispatcher/index.js
View file @
c8823720
...
...
@@ -16,7 +16,7 @@ let db = new Map()
app
.
use
(
morgan
(
'
combined
'
))
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
bodyParser
.
json
())
const
file_path
=
__dirname
+
"
/repository
"
const
file_path
=
__dirname
+
"
/repository
/
"
app
.
use
(
'
/repository
'
,
express
.
static
(
file_path
));
app
.
use
(
fileUpload
())
...
...
@@ -42,7 +42,7 @@ app.post('/serverless/deploy', (req, res) => {
}
else
{
if
(
runtime
===
"
container
"
)
{
deployContainer
(
'
./
test
/
'
,
functionHash
)
deployContainer
(
'
./
repository
/
'
,
functionHash
)
.
then
(()
=>
{
res
.
json
({
status
:
"
success
"
,
...
...
@@ -69,7 +69,7 @@ function deployContainer(path, imageName) {
return
new
Promise
((
resolve
,
reject
)
=>
{
let
buildStart
=
Date
.
now
()
fs
.
writeFile
(
'
./
test
/Dockerfile
'
,
fs
.
writeFile
(
'
./
repository
/Dockerfile
'
,
`FROM node:latest
WORKDIR /app
COPY package.json /app
...
...
@@ -85,7 +85,7 @@ function deployContainer(path, imageName) {
}
else
{
console
.
log
(
'
Dockerfile created
'
);
const
process
=
spawn
(
'
docker
'
,
[
"
build
"
,
"
-t
"
,
imageName
,
path
,
"
-q
"
]);
const
process
=
spawn
(
'
docker
'
,
[
"
build
"
,
"
-t
"
,
imageName
,
path
]);
process
.
stdout
.
on
(
'
data
'
,
(
data
)
=>
{
console
.
log
(
`stdout:
${
data
}
`
);
...
...
dispatcher/package.json
View file @
c8823720
...
...
@@ -15,6 +15,7 @@
"express-fileupload"
:
"^1.1.6"
,
"isolated-vm"
:
"^3.0.0"
,
"morgan"
:
"^1.9.1"
,
"mqtt"
:
"^3.0.0"
,
"nano"
:
"^8.1.0"
,
"redis"
:
"^2.8.0"
,
"save"
:
"^2.4.0"
...
...
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