Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
misc, webserver: use circus to manage git-daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Souza committed Jan 21, 2013
1 parent 86ffabc commit 53e1dba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 79 deletions.
6 changes: 6 additions & 0 deletions misc/circus.ini
Expand Up @@ -10,6 +10,12 @@ cmd = /home/git/gandalf/dist/gandalf-webserver
uid = git
copy_env = True

[watcher:git-daemon]
cmd = git
args = daemon --base-path=/repositories/path --syslog --export-all
copy_env = True
uid = git

[watcher:mongodb]
cmd = /home/ubuntu/tsuru/start-mongo.bash
args = /var/lib/mongodb
Expand Down
15 changes: 0 additions & 15 deletions webserver/main.go
Expand Up @@ -6,28 +6,14 @@ package main

import (
"flag"
"fmt"
"github.com/bmizerany/pat"
"github.com/globocom/config"
"github.com/globocom/gandalf/api"
"github.com/globocom/gandalf/db"
"log"
"net/http"
"os/exec"
)

func startGitDaemon() error {
bLocation, err := config.GetString("git:bare:location")
if err != nil {
return err
}
args := []string{"daemon", fmt.Sprintf("--base-path=%s", bLocation), "--syslog"}
if exportAll, err := config.GetBool("git:daemon:export-all"); err == nil && exportAll {
args = append(args, "--export-all")
}
return exec.Command("git", args...).Run()
}

func main() {
dry := flag.Bool("dry", false, "dry-run: does not start the server and git daemon (for testing purpose)")
configFile := flag.String("config", "/etc/gandalf.conf", "Gandalf configuration file")
Expand Down Expand Up @@ -55,7 +41,6 @@ For an example conf check gandalf/etc/gandalf.conf file.`
panic(err)
}
if !*dry {
startGitDaemon()
log.Fatal(http.ListenAndServe(port, router))
}
}
64 changes: 0 additions & 64 deletions webserver/main_test.go

This file was deleted.

0 comments on commit 53e1dba

Please sign in to comment.