mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
hooked up custom docker instances from config file
This commit is contained in:
parent
0be010bb49
commit
80f7523e9b
7 changed files with 38 additions and 27 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.git
|
15
README.md
15
README.md
|
@ -113,6 +113,21 @@ Or a combination of the two:
|
||||||
DRONE_GITLAB_URL="https://gitlab.com" ./drone --config=/path/to/drone.conf
|
DRONE_GITLAB_URL="https://gitlab.com" ./drone --config=/path/to/drone.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## GitHub
|
||||||
|
|
||||||
|
In order to setup with GitHub you'll need to register your local Drone installation
|
||||||
|
with GitHub (or GitHub Enterprise). You can read more about registering an application here:
|
||||||
|
https://github.com/settings/applications/new
|
||||||
|
|
||||||
|
Below are example values when running Drone locally. If you are running Drone on a server
|
||||||
|
you should replace `localhost` with your server hostname or address.
|
||||||
|
|
||||||
|
Homepage URL:
|
||||||
|
http://localhost:8000/
|
||||||
|
|
||||||
|
Authorization callback URL:
|
||||||
|
http://localhost:8000/api/auth/github.com
|
||||||
|
|
||||||
## Compatibility Issues
|
## Compatibility Issues
|
||||||
|
|
||||||
**WARNING**
|
**WARNING**
|
||||||
|
|
4
debian/drone/etc/default/drone
vendored
4
debian/drone/etc/default/drone
vendored
|
@ -4,10 +4,10 @@
|
||||||
#
|
#
|
||||||
# -datasource="drone.sqlite":
|
# -datasource="drone.sqlite":
|
||||||
# -driver="sqlite3":
|
# -driver="sqlite3":
|
||||||
# -port=":8080":
|
# -bind=":8080":
|
||||||
# -workers="4":
|
# -workers="4":
|
||||||
#
|
#
|
||||||
#DRONED_OPTS="--port=:80"
|
#DRONED_OPTS="--bind=:80"
|
||||||
|
|
||||||
# Email configuration
|
# Email configuration
|
||||||
#DRONE_SMTP_HOST=
|
#DRONE_SMTP_HOST=
|
||||||
|
|
2
debian/drone/etc/init/drone.conf
vendored
2
debian/drone/etc/init/drone.conf
vendored
|
@ -5,7 +5,7 @@ console log
|
||||||
|
|
||||||
script
|
script
|
||||||
set -a
|
set -a
|
||||||
DRONED_OPTS="--port=:80"
|
DRONED_OPTS="--bind=:80"
|
||||||
if [ -f /etc/default/$UPSTART_JOB ]; then
|
if [ -f /etc/default/$UPSTART_JOB ]; then
|
||||||
. /etc/default/$UPSTART_JOB
|
. /etc/default/$UPSTART_JOB
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<div class="pure-u-1-4 pure-u-md-1-6">
|
<div class="pure-u-1-4 pure-u-md-1-6">
|
||||||
<div>
|
<div>
|
||||||
<a href="https://gravatar.com/" target="_blank">
|
<a href="https://gravatar.com/" target="_blank">
|
||||||
<img ng-src="{{ account.gravatar | gravatar }}" />
|
<img ng-src="{{ account.gravatar | gravatarLarge }}" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -97,24 +97,18 @@ func main() {
|
||||||
|
|
||||||
// Create the worker, director and builders
|
// Create the worker, director and builders
|
||||||
workers = pool.New()
|
workers = pool.New()
|
||||||
workers.Allocate(docker.New())
|
|
||||||
workers.Allocate(docker.New())
|
|
||||||
workers.Allocate(docker.New())
|
|
||||||
workers.Allocate(docker.New())
|
|
||||||
worker = director.New()
|
worker = director.New()
|
||||||
|
|
||||||
pub = pubsub.NewPubSub()
|
|
||||||
/*
|
|
||||||
if nodes == nil || len(nodes) == 0 {
|
if nodes == nil || len(nodes) == 0 {
|
||||||
worker.NewWorker(workerc, users, repos, commits, pubsub, &model.Server{}).Start()
|
workers.Allocate(docker.New())
|
||||||
worker.NewWorker(workerc, users, repos, commits, pubsub, &model.Server{}).Start()
|
workers.Allocate(docker.New())
|
||||||
} else {
|
} else {
|
||||||
for _, node := range nodes {
|
for _, node := range nodes {
|
||||||
println(node)
|
workers.Allocate(docker.NewHost(node))
|
||||||
worker.NewWorker(workerc, users, repos, commits, pubsub, &model.Server{Host: node}).Start()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
pub = pubsub.NewPubSub()
|
||||||
|
|
||||||
goji.Get("/api/logins", handler.GetLoginList)
|
goji.Get("/api/logins", handler.GetLoginList)
|
||||||
goji.Get("/api/stream/stdout/:id", handler.WsConsole)
|
goji.Get("/api/stream/stdout/:id", handler.WsConsole)
|
||||||
|
@ -177,13 +171,6 @@ func main() {
|
||||||
goji.Use(middleware.SetHeaders)
|
goji.Use(middleware.SetHeaders)
|
||||||
goji.Use(middleware.SetUser)
|
goji.Use(middleware.SetUser)
|
||||||
goji.Serve()
|
goji.Serve()
|
||||||
|
|
||||||
// start webserver using HTTPS or HTTP
|
|
||||||
//if len(sslcert) != 0 {
|
|
||||||
// panic(http.ListenAndServeTLS(port, sslcert, sslkey, nil))
|
|
||||||
//} else {
|
|
||||||
//panic(http.ListenAndServe(port, nil))
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextMiddleware creates a new go.net/context and
|
// ContextMiddleware creates a new go.net/context and
|
||||||
|
|
|
@ -37,7 +37,15 @@ func New() *Docker {
|
||||||
Kind: dockerKind,
|
Kind: dockerKind,
|
||||||
Created: time.Now().UTC().Unix(),
|
Created: time.Now().UTC().Unix(),
|
||||||
docker: docker.New(),
|
docker: docker.New(),
|
||||||
//docker.NewHost(w.server.Host)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewHost(host string) *Docker {
|
||||||
|
return &Docker{
|
||||||
|
UUID: uuid.New(),
|
||||||
|
Kind: dockerKind,
|
||||||
|
Created: time.Now().UTC().Unix(),
|
||||||
|
docker: docker.NewHost(host),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue