fixed some minor bugs in build
This commit is contained in:
parent
1ef6dc0bc6
commit
d66becd12c
4 changed files with 24 additions and 8 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -20,3 +20,7 @@ bindata.go
|
||||||
drone
|
drone
|
||||||
drone-build
|
drone-build
|
||||||
drone-bot
|
drone-bot
|
||||||
|
|
||||||
|
bin/drone
|
||||||
|
bin/drone-build
|
||||||
|
bin/drone-bot
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
.PHONY: dist
|
||||||
|
|
||||||
SHA := $(shell git rev-parse --short HEAD)
|
SHA := $(shell git rev-parse --short HEAD)
|
||||||
VERSION := 0.4.0-alpha
|
VERSION := 0.4.0-alpha
|
||||||
|
|
||||||
|
@ -11,7 +13,7 @@ test:
|
||||||
go test -cover -short ./...
|
go test -cover -short ./...
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -ldflags "-X main.revision $(SHA) -X main.version $(VERSION).$(SHA)"
|
go build -o bin/drone -ldflags "-X main.revision $(SHA) -X main.version $(VERSION).$(SHA)"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
find . -name "*.out" -delete
|
find . -name "*.out" -delete
|
||||||
|
@ -33,3 +35,12 @@ bindata_debug:
|
||||||
|
|
||||||
bindata:
|
bindata:
|
||||||
$$GOPATH/bin/go-bindata server/static/...
|
$$GOPATH/bin/go-bindata server/static/...
|
||||||
|
|
||||||
|
# creates a debian package for drone
|
||||||
|
# to install `sudo dpkg -i drone.deb`
|
||||||
|
dist:
|
||||||
|
mkdir -p dist/drone/usr/local/bin
|
||||||
|
mkdir -p dist/drone/var/lib/drone
|
||||||
|
mkdir -p dist/drone/var/cache/drone
|
||||||
|
cp bin/drone dist/drone/usr/local/bin
|
||||||
|
-dpkg-deb --build dist/drone
|
||||||
|
|
|
@ -102,7 +102,7 @@ func run(client dockerclient.Client, conf *dockerclient.ContainerConfig, pull bo
|
||||||
id, err = client.CreateContainer(conf, "")
|
id, err = client.CreateContainer(conf, "")
|
||||||
// make sure the container is removed in
|
// make sure the container is removed in
|
||||||
// the event of a creation error.
|
// the event of a creation error.
|
||||||
if len(id) != 0 {
|
if err != nil && len(id) != 0 {
|
||||||
client.RemoveContainer(id, true, true)
|
client.RemoveContainer(id, true, true)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -134,11 +134,12 @@ func runSteps(c *Context, steps map[string]*common.Step) (int, error) {
|
||||||
|
|
||||||
// verify the step matches the branch
|
// verify the step matches the branch
|
||||||
// and other specifications
|
// and other specifications
|
||||||
if step.Condition == nil ||
|
if step.Condition != nil {
|
||||||
!step.Condition.MatchOwner(c.Repo.Owner) ||
|
if !step.Condition.MatchOwner(c.Repo.Owner) ||
|
||||||
!step.Condition.MatchBranch(c.Clone.Branch) ||
|
!step.Condition.MatchBranch(c.Clone.Branch) ||
|
||||||
!step.Condition.MatchMatrix(c.Build.Environment) {
|
!step.Condition.MatchMatrix(c.Build.Environment) {
|
||||||
continue
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
conf := toContainerConfig(step)
|
conf := toContainerConfig(step)
|
||||||
|
|
Loading…
Reference in a new issue