Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
10ef0363
Commit
10ef0363
authored
Jul 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send info in the package JSON file as package status
parent
d9d2976c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
47 deletions
+9
-47
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+9
-47
No files found.
debomatic-webui/lib/client.js
View file @
10ef0363
...
@@ -62,56 +62,15 @@ function __read_package_status(data, cb) {
...
@@ -62,56 +62,15 @@ function __read_package_status(data, cb) {
});
});
}
}
function
__send_package_status
(
socket
,
data
,
package_data
)
{
function
__send_package_info
(
socket
,
data
)
{
__read_package_status
(
data
,
function
(
content
)
{
var
event_name
=
config
.
events
.
client
.
distribution_packages_status
;
socket
.
emit
(
_e
.
package_info
,
content
);
var
new_data
=
{};
new_data
.
distribution
=
data
.
distribution
;
new_data
.
package
=
package_data
;
var
status_data
=
{};
status_data
.
status
=
config
.
status
.
build
;
status_data
.
distribution
=
data
.
distribution
.
name
;
status_data
.
package
=
package_data
.
orig_name
;
var
package_path
=
utils
.
get_package_path
(
new_data
);
// status policy:
// + successed: exists .dsc
// + building: wc -l .datestamp == 1 (FIX_ME)
// + failed: else
var
base_path
=
path
.
join
(
package_path
,
package_data
.
orig_name
);
fs
.
exists
(
base_path
+
'
.dsc
'
,
function
(
dsc_exists
)
{
if
(
dsc_exists
)
{
status_data
.
success
=
config
.
status
.
success
;
socket
.
emit
(
event_name
,
status_data
);
}
else
{
// emulate wc -l .datestamp in nodejs
var
count
=
0
;
var
datestamp
=
base_path
+
'
.datestamp
'
;
fs
.
exists
(
datestamp
,
function
(
datestamp_exists
)
{
if
(
datestamp_exists
)
{
// count lines
fs
.
createReadStream
(
datestamp
)
.
on
(
'
data
'
,
function
(
chunk
)
{
for
(
var
i
=
0
;
i
<
chunk
.
length
;
++
i
)
if
(
chunk
[
i
]
==
10
)
count
++
;
})
.
on
(
'
end
'
,
function
()
{
if
(
count
>
1
)
status_data
.
success
=
config
.
status
.
fail
;
socket
.
emit
(
event_name
,
status_data
);
});
}
});
}
});
});
}
}
function
__send_package_
info
(
socket
,
data
)
{
function
__send_package_
status
(
socket
,
data
)
{
__read_package_status
(
data
,
function
(
content
)
{
__read_package_status
(
data
,
function
(
content
)
{
socket
.
emit
(
_e
.
package_info
,
content
);
socket
.
emit
(
_e
.
distribution_packages_status
,
content
);
});
});
}
}
...
@@ -125,8 +84,11 @@ function __send_distribution_packages(event_name, socket, data) {
...
@@ -125,8 +84,11 @@ function __send_distribution_packages(event_name, socket, data) {
pack
.
name
=
info
[
0
];
pack
.
name
=
info
[
0
];
pack
.
version
=
info
[
1
];
pack
.
version
=
info
[
1
];
pack
.
orig_name
=
p
;
pack
.
orig_name
=
p
;
__send_package_status
(
socket
,
{
distribution
:
data
.
distribution
,
package
:
pack
});
data
.
distribution
.
packages
.
push
(
pack
);
data
.
distribution
.
packages
.
push
(
pack
);
__send_package_status
(
socket
,
data
,
pack
);
});
});
socket
.
emit
(
event_name
,
data
);
socket
.
emit
(
event_name
,
data
);
});
});
...
...
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