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 all 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Folders
_obj
_test
/tmp/

# Architecture specific extensions/prefixes
*.[568vq]
Expand All @@ -21,6 +22,7 @@ _testmain.go

*.exe
*.gob
*.gob.new
*.bolt

/conf.json
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Development

You'll need to perform the following steps to get a basic server running:

1. Install [gosl](https://github.com/daviddengcn/gosl) (`go get github.com/daviddengcn/gosl`).
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. Install dependencies: `./scripts/install.gs`
1. Run the crawler: `./scripts/crawler.gs`
1. Run the server: `./scripts/server.gs`
1. Visit [http://localhost:8080](http://localhost:8080) in your browser


Expand Down
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",
}
}
11 changes: 10 additions & 1 deletion scripts/install.gs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ if *goGet {
Printfln("go get -u -v %s/%s", GCSE, a)
MustSucc(Bash("go get -u -v %s/%s", GCSE, a))
}

additionalPackages := []string{
Copy link
Owner

Choose a reason for hiding this comment

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

why this is necessary? Won't previous go get automatically get these dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, when I tested this morning:

  • go test (called later in install.gs) complained about missing github.com/golangplus/testing/assert
  • crawler complained about fmt and heap

Copy link
Owner

Choose a reason for hiding this comment

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

This is weird and getting the dependencies explicitly seems not an optimal solution. I'll have a test later.

"github.com/golangplus/fmt",
"github.com/golangplus/container/heap",
"github.com/golangplus/testing/assert",
}
for _, pkg := range additionalPackages {
Printfln("go get -u -v %s", pkg)
MustSucc(Bash("go get -u -v %s", pkg))
}
}

Println("go test -a")
Expand All @@ -31,4 +41,3 @@ for _, a := range APPS {
Printfln("go install -a %s/%s", GCSE, a)
MustSucc(Bash("go install -a %s/%s", GCSE, a))
}