Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve DevDocs #32

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ Development
You'll need to perform the following steps to get a basic server running:

1. Create a basic `conf.json` file, limiting the crawler to a one minute run: `{ "crawler": { "due_per_run": "1m" } }`
1. Run the package finder: `go run tocrawl/*.go`
1. Run the crawler: `go run crawler/*.go`
1. Merge the crawled docs: `go run mergedocs/*.go`
1. Run the indexer: `go run indexer/*.go`
1. Run the server: ` go run server/*.go`
1. Create the data dir: `mkdir -p data/docs`
1. Run the package finder: `go run pipelines/tocrawl/*.go`
1. Run the crawler: `go run pipelines/crawler/*.go`
1. Merge the crawled docs: `go run pipelines/mergedocs/*.go`
1. Run the indexer: `go run pipelines/indexer/*.go`
1. Run the server:
- `go install ./server`
- `$GOPATH/bin/server`
1. Visit [http://localhost:8080](http://localhost:8080) in your browser

You can also use the `bootstrap.sh` script to get you started!


LICENSE
-------
Expand Down
34 changes: 34 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

cd "$(dirname $0)"

set -e

# create config
if [ ! -f conf.json ]; then
echo '{ "crawler": { "due_per_run": "1m" } }' > config.json
fi

# create neccessary directories
mkdir -p data/docs

# install dependencies
go get github.com/daviddengcn/gcse
go get github.com/golangplus/fmt
go get github.com/golangplus/container/heap

echo '---> Running package finder...'
echo ' This may take a few minutes'
go run pipelines/tocrawl/*.go

echo '---> Running crawler...'
go run pipelines/crawler/*.go

echo '---> Merging docs...'
go run pipelines/mergedocs/*.go

echo '---> Running indexer...'
go run pipelines/indexer/*.go

echo '---> Thats it!'
echo ' To start the webserver, call ./server.sh'
52 changes: 26 additions & 26 deletions conf.json.template
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
web: {
// addr: ":8080"
// root: "./server/"
// loadtemplatepass: ""
// autoloadtemplate: false
}
"web": {
//"addr": ":8080",
//"root": "./server/",
//"loadtemplatepass": "",
//"autoloadtemplate": false
},

back: {
// dbroot: "./data/"
}
"back": {
//"dbroot": "./data/"
},

crawler: {
// due_per_run: "1h"
// godoc: true
// github_update: true
// noncrawl_hosts: []
// github: {
// clientid: ""
// clientsecret: ""
// }
}
"crawler": {
//"due_per_run": "1h",
//"godoc": true,
//"github_update": true,
//"noncrawl_hosts": [],
//"github": {
// "clientid": "",
// "clientsecret": "",
//}
},

docdb: {
// nonstore_regexps: []
}
"docdb": {
//"nonstore_regexps": [],
},

bi: {
// data_path: "/tmp/gcse.bolt"
// web_path: "/bi"
}
"bi": {
//"data_path": "/tmp/gcse.bolt",
//"web_path": "/bi",
}
}
6 changes: 6 additions & 0 deletions server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've written a installing script at "scripts/install.gs" which can be executed with gosl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I've googled for gosl but only the Go Scientific Lib came up

# build and run the local server

cd "$(dirname $0)"
go install ./server
exec $GOPATH/bin/server