Skip to content

Commit e1951fb

Browse files
committed
stage
1 parent 729f70b commit e1951fb

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ MANIFEST-*
3636

3737
srv/data*
3838

39-
.ignore*
39+
.ignore*
40+
41+
42+
docker/stage/app

docker/stage/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
FROM nodezoo-shared
3+
4+
ADD app /app/
5+
6+
CMD ["node", "/app/srv/github-stage.js"]
7+
8+
9+
10+
11+

docker/stage/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build :
2+
mkdir -p app/data
3+
mkdir -p app/srv
4+
cp -r ../../github.js app
5+
cp -r ../../srv/*.js app/srv
6+
docker build -t nodezoo-github .
7+
8+
clean :
9+
rm *~
10+
11+
.PHONY : build clean

srv/github-stage.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* Copyright (c) 2014-2017 Richard Rodger and other contributors, MIT License */
2+
3+
var PORT = process.env.PORT || 9000
4+
var Seneca = require('seneca')
5+
6+
Seneca({tag: 'github'})
7+
.listen(PORT)
8+
9+
.use('entity')
10+
.use('jsonfile-store', {folder: __dirname+'/../data'})
11+
12+
.use('../github.js')
13+
14+
.add('role:info,need:part',function(args,done){
15+
done()
16+
17+
this.act(
18+
'role:github,cmd:get',
19+
{name:args.name},
20+
21+
function(err,mod){
22+
if( err ) return;
23+
24+
if( mod ) {
25+
return this.act(
26+
'role:info,collect:part,part:github',
27+
{name:args.name,data:this.util.clean(mod.data$())})
28+
}
29+
30+
this.act(
31+
'role:npm,cmd:get', {name:args.name},
32+
function(err,mod){
33+
if( err ) return;
34+
35+
if( mod ) {
36+
this.act(
37+
'role:github,cmd:get',
38+
{name:args.name,giturl:mod.giturl},
39+
function( err, mod ){
40+
if( err ) return;
41+
42+
if( mod ) {
43+
this.act('role:info,collect:part,part:github',
44+
{name:args.name,data:this.util.clean(mod.data$())})
45+
}
46+
})
47+
}
48+
})
49+
})
50+
})
51+
52+
.client({pin:'role:info', host:'info', port:PORT})
53+
.client({pin:'role:npm', host:'npm', port:PORT})
54+
55+

0 commit comments

Comments
 (0)