Merge pull request #1615 from bradrydzewski/master

Migrate yaml to 0.5
This commit is contained in:
Brad Rydzewski 2016-05-04 00:20:54 -07:00
commit 81a53daf72
8 changed files with 29 additions and 22 deletions

View file

@ -1 +0,0 @@
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.RPXRWzmKbZ6KShRzmd1adFofHAofk6weJrzfjEd0-gRoscpoHrbvGy-DOUVOjwfI41H52EBFV8L_-8uXdRKkCsLnzDpWYmbSKAkKLGDMAILlQcGr4-C_6_duP8nK6Lw2MuAeP8KACBnHVXaosks-ARr7bC5hzQBgJLMuxw3O40jkMS7J62T1Oo7CRkSlLpAIu0axmWQ6ZlfRhijyZUMAJTfegykgrMbpL-FlyDsRpHYkCC0Ny5tN2Q4Gocmxwgitv8_uNZqXYuOAxQXEwXTSyLkXhBdIDtNLDXkAmglTdCB7mis-SmOw4lxSEMAU20bFqOrtbOP_5jwIPoLO8FR4Fw.TU_hlTlqCRZdI-Jw.NBZUu2Wv6ZRzoRpcrEyg2V-me_XEAI22HT_BOJ1NS1bhPLWx1zCbu8hfWNI9RBUMvppSzFw6leeUXgFGqOjGquVvAOCBi0pKuPVW5jGkmv3kM43ciUzzR5MErAg_VPqQjKkV5RvsSu7gKHr6PTSOmc8hPU9JyfNNMUh4MGOHJnvv3I-oKJva3oOt-y9KPsuGLo-6hM1WbhYyPvcm3PSiBrKkOZM5f0_2nqcZZzHQ8gvo5BmzxcSAYVmKRo8_rLROMqT1fycnWg_4qsJuD6molP9b-88Vb0vrZ2jpvm-f_Cq2psSPPMQIcxSvlweO-dP7u0WvdLnOsIb-cq6HxqorTxtKSKcsGbqv66gLsThsa8KDivreyRFyHhTiKwTugv8Kw4Fxsfhj6hzbuI6Vy5Utyr6OJ30MRpg8kg.qKp-C7QNFaeU0HZJ6Qwp8g

View file

@ -1,24 +1,36 @@
clone:
path: github.com/drone/drone
workspace:
base: /drone
path: src/github.com/drone/drone
build:
script:
test:
image: drone/golang:1.5
environment:
- GO15VENDOREXPERIMENT=1
- GOPATH=/drone
commands:
- export PATH=$PATH:$GOPATH/bin
- make deps gen
- make test test_postgres test_mysql
dist:
image: drone/golang:1.5
environment:
- GO15VENDOREXPERIMENT=1
- GOPATH=/drone
commands:
- export PATH=$PATH:$GOPATH/bin
- make build
when:
event: push
compose:
docker:
repo: drone/drone
tag: [ "0.5.0" ]
when:
branch: master
event: push
services:
postgres:
image: postgres:9.4.5
environment:
@ -28,18 +40,3 @@ compose:
environment:
- MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
publish:
docker:
username: drone
password: $$DOCKER_PASS
email: $$DOCKER_EMAIL
repo: drone/drone
tag: [ "0.5.0" ]
when:
repo: drone/drone
branch: master
notify:
gitter:
webhook: https://webhooks.gitter.im/e/$$GITTER_KEY

1
.drone.yml.sig Normal file
View file

@ -0,0 +1 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9kcm9uZQogIHBhdGg6IHNyYy9naXRodWIuY29tL2Ryb25lL2Ryb25lCgpzY3JpcHQ6CiAgdGVzdDoKICAgIGltYWdlOiBkcm9uZS9nb2xhbmc6MS41CiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBHTzE1VkVORE9SRVhQRVJJTUVOVD0xCiAgICAgIC0gR09QQVRIPS9kcm9uZQogICAgY29tbWFuZHM6CiAgICAgIC0gZXhwb3J0IFBBVEg9JFBBVEg6JEdPUEFUSC9iaW4KICAgICAgLSBtYWtlIGRlcHMgZ2VuCiAgICAgIC0gbWFrZSB0ZXN0IHRlc3RfcG9zdGdyZXMgdGVzdF9teXNxbAogIGRpc3Q6CiAgICBpbWFnZTogZHJvbmUvZ29sYW5nOjEuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gR08xNVZFTkRPUkVYUEVSSU1FTlQ9MQogICAgICAtIEdPUEFUSD0vZHJvbmUKICAgIGNvbW1hbmRzOgogICAgICAtIGV4cG9ydCBQQVRIPSRQQVRIOiRHT1BBVEgvYmluCiAgICAgIC0gbWFrZSBidWlsZAogICAgd2hlbjoKICAgICAgZXZlbnQ6IHB1c2gKCiAgZG9ja2VyOgogICAgcmVwbzogZHJvbmUvZHJvbmUKICAgIHRhZzogWyAiMC41LjAiIF0KICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIGV2ZW50OiBwdXNoCgpzZXJ2aWNlczoKICBwb3N0Z3JlczoKICAgIGltYWdlOiBwb3N0Z3Jlczo5LjQuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gUE9TVEdSRVNfVVNFUj1wb3N0Z3JlcwogIG15c3FsOgogICAgaW1hZ2U6IG15c3FsOjUuNi4yNwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTVlTUUxfREFUQUJBU0U9dGVzdAogICAgICAtIE1ZU1FMX0FMTE9XX0VNUFRZX1BBU1NXT1JEPXllcwo.IPNe-a5DwuYHja-Jq1B399SnDGUpxk52rWlKqAhCBIs

View file

@ -245,7 +245,7 @@ func (c *client) open(rawurl, method string, in, out interface{}) (io.ReadCloser
if resp.StatusCode > http.StatusPartialContent {
defer resp.Body.Close()
out, _ := ioutil.ReadAll(resp.Body)
return nil, fmt.Errorf(string(out))
return nil, fmt.Errorf("client error %d: %s", resp.StatusCode, string(out))
}
return resp.Body, nil
}

View file

@ -52,6 +52,12 @@ var AgentCmd = cli.Command{
Usage: "docker architecture system",
Value: "amd64",
},
cli.StringFlag{
EnvVar: "DOCKER_STORAGE_DRIVER",
Name: "docker-storage-driver",
Usage: "docker storage driver",
Value: "overlay",
},
cli.StringFlag{
EnvVar: "DRONE_SERVER",
Name: "drone-server",

View file

@ -17,6 +17,7 @@ import (
"github.com/drone/drone/engine/runner/docker"
"github.com/drone/drone/model"
"github.com/drone/drone/queue"
"github.com/drone/drone/version"
"github.com/drone/drone/yaml/expander"
"github.com/samalba/dockerclient"
@ -255,6 +256,7 @@ func toEnv(w *queue.Work) map[string]string {
"DRONE_YAML_SIGNED": fmt.Sprintf("%v", w.Signed),
"DRONE_BRANCH": w.Build.Branch,
"DRONE_COMMIT": w.Build.Commit,
"DRONE_VERSION": version.Version,
}
if w.Build.Event == model.EventTag {

View file

@ -18,7 +18,7 @@ func Agents(cli *cli.Context) gin.HandlerFunc {
logrus.Fatalf("failed to generate token from DRONE_AGENT_SECRET")
}
t := token.New(secret, "")
t := token.New(token.AgentToken, secret)
s, err := t.Sign(secret)
if err != nil {
logrus.Fatalf("failed to generate token from DRONE_AGENT_SECRET. %s", err)

View file

@ -18,8 +18,10 @@ func AuthorizeAgent(c *gin.Context) {
})
if err != nil {
c.String(500, "invalid or empty token. %s", err)
c.Abort()
} else if parsed.Kind != token.AgentToken {
c.String(403, "invalid token. please use an agent token")
c.Abort()
} else {
c.Next()
}