├── Godeps
├── _workspace
│ ├── .gitignore
│ └── src
│ │ ├── github.com
│ │ ├── dotcloud
│ │ │ └── docker
│ │ │ │ ├── utils
│ │ │ │ ├── testdata
│ │ │ │ │ └── fs
│ │ │ │ │ │ ├── a
│ │ │ │ │ │ ├── d
│ │ │ │ │ │ ├── e
│ │ │ │ │ │ └── f
│ │ │ │ │ │ ├── b
│ │ │ │ │ │ └── h
│ │ │ │ │ │ └── g
│ │ │ │ ├── uname_unsupported.go
│ │ │ │ ├── random.go
│ │ │ │ ├── uname_linux.go
│ │ │ │ ├── checksum.go
│ │ │ │ ├── daemon.go
│ │ │ │ ├── jsonmessage_test.go
│ │ │ │ └── signal_freebsd.go
│ │ │ │ ├── vendor
│ │ │ │ └── src
│ │ │ │ │ └── code.google.com
│ │ │ │ │ └── p
│ │ │ │ │ └── go
│ │ │ │ │ └── src
│ │ │ │ │ └── pkg
│ │ │ │ │ └── archive
│ │ │ │ │ └── tar
│ │ │ │ │ ├── testdata
│ │ │ │ │ ├── small.txt
│ │ │ │ │ ├── small2.txt
│ │ │ │ │ ├── v7.tar
│ │ │ │ │ ├── writer-big.tar
│ │ │ │ │ └── nil-uid.tar
│ │ │ │ │ ├── stat_atim.go
│ │ │ │ │ ├── stat_atimespec.go
│ │ │ │ │ └── stat_unix.go
│ │ │ │ ├── archive
│ │ │ │ ├── MAINTAINERS
│ │ │ │ └── stat_unsupported.go
│ │ │ │ ├── pkg
│ │ │ │ ├── term
│ │ │ │ │ ├── MAINTAINERS
│ │ │ │ │ └── termios_linux.go
│ │ │ │ └── system
│ │ │ │ │ ├── errors.go
│ │ │ │ │ ├── unsupported.go
│ │ │ │ │ ├── stat_linux.go
│ │ │ │ │ ├── stat_unsupported.go
│ │ │ │ │ ├── xattrs_unsupported.go
│ │ │ │ │ ├── utimes_unsupported.go
│ │ │ │ │ ├── setns_linux.go
│ │ │ │ │ ├── utimes_linux.go
│ │ │ │ │ └── proc.go
│ │ │ │ └── dockerversion
│ │ │ │ └── dockerversion.go
│ │ ├── russross
│ │ │ └── meddler
│ │ │ │ ├── .gitignore
│ │ │ │ └── doc.go
│ │ ├── bmizerany
│ │ │ └── pat
│ │ │ │ ├── .gitignore
│ │ │ │ ├── bench_test.go
│ │ │ │ └── example
│ │ │ │ ├── hello.go
│ │ │ │ └── hello_appengine.go
│ │ ├── plouc
│ │ │ └── go-gitlab-client
│ │ │ │ ├── Godeps
│ │ │ │ ├── .gitignore
│ │ │ │ ├── examples
│ │ │ │ └── config.json.sample
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── stubs
│ │ │ │ ├── hooks
│ │ │ │ │ ├── show.json
│ │ │ │ │ ├── issue.json
│ │ │ │ │ ├── merge_request.json
│ │ │ │ │ └── push.json
│ │ │ │ ├── public_keys
│ │ │ │ │ ├── show.json
│ │ │ │ │ └── index.json
│ │ │ │ ├── users
│ │ │ │ │ ├── show.json
│ │ │ │ │ ├── current.json
│ │ │ │ │ └── index.json
│ │ │ │ ├── commits
│ │ │ │ │ └── index.json
│ │ │ │ ├── tags
│ │ │ │ │ └── index.json
│ │ │ │ └── branches
│ │ │ │ │ ├── show.json
│ │ │ │ │ └── index.json
│ │ │ │ ├── helper_test.go
│ │ │ │ ├── gitlab_test.go
│ │ │ │ ├── projects_test.go
│ │ │ │ ├── repositories_test.go
│ │ │ │ └── public_keys_test.go
│ │ ├── GeertJohan
│ │ │ ├── go.incremental
│ │ │ │ ├── .gitignore
│ │ │ │ ├── doc.go
│ │ │ │ ├── int.go
│ │ │ │ ├── int8.go
│ │ │ │ ├── uint.go
│ │ │ │ ├── int16.go
│ │ │ │ ├── int32.go
│ │ │ │ ├── int64.go
│ │ │ │ ├── uint8.go
│ │ │ │ ├── uint16.go
│ │ │ │ ├── uint32.go
│ │ │ │ ├── uint64.go
│ │ │ │ ├── example
│ │ │ │ │ └── example.go
│ │ │ │ └── README.md
│ │ │ └── go.rice
│ │ │ │ ├── example
│ │ │ │ ├── example-files
│ │ │ │ │ ├── file.txt
│ │ │ │ │ └── img
│ │ │ │ │ │ └── doge.jpg
│ │ │ │ └── example-templates
│ │ │ │ │ └── message.tmpl
│ │ │ │ ├── embedded-a.go
│ │ │ │ ├── debug.go
│ │ │ │ ├── .gitignore
│ │ │ │ ├── rice
│ │ │ │ ├── identifier.go
│ │ │ │ ├── util.go
│ │ │ │ ├── clean.go
│ │ │ │ └── main.go
│ │ │ │ ├── http.go
│ │ │ │ └── LICENSE
│ │ ├── jacobsa
│ │ │ └── oglematchers
│ │ │ │ ├── .gitignore
│ │ │ │ ├── any.go
│ │ │ │ └── transform_description.go
│ │ ├── dchest
│ │ │ ├── uniuri
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── uniuri_test.go
│ │ │ │ └── LICENSE
│ │ │ ├── passwordreset
│ │ │ │ ├── .gitignore
│ │ │ │ └── LICENSE
│ │ │ └── authcookie
│ │ │ │ └── LICENSE
│ │ ├── jessevdk
│ │ │ └── go-flags
│ │ │ │ ├── termsize_linux.go
│ │ │ │ ├── termsize_unix.go
│ │ │ │ ├── termsize_other.go
│ │ │ │ ├── termsize_nosysioctl.go
│ │ │ │ ├── check_crosscompile.sh
│ │ │ │ ├── termsize.go
│ │ │ │ ├── examples
│ │ │ │ ├── add.go
│ │ │ │ └── rm.go
│ │ │ │ ├── options_test.go
│ │ │ │ ├── closest.go
│ │ │ │ ├── tag_test.go
│ │ │ │ └── unknown_test.go
│ │ ├── go-sql-driver
│ │ │ └── mysql
│ │ │ │ ├── .gitignore
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── result.go
│ │ │ │ ├── transaction.go
│ │ │ │ └── AUTHORS
│ │ ├── smartystreets
│ │ │ └── goconvey
│ │ │ │ └── convey
│ │ │ │ ├── assertions
│ │ │ │ ├── init.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── filter.go
│ │ │ │ ├── serializer.go
│ │ │ │ └── serializer_test.go
│ │ │ │ ├── reporting
│ │ │ │ ├── doc.go
│ │ │ │ ├── console.go
│ │ │ │ ├── gotest.go
│ │ │ │ ├── dot.go
│ │ │ │ ├── dot_test.go
│ │ │ │ ├── reporter.go
│ │ │ │ ├── problems_test.go
│ │ │ │ └── printer.go
│ │ │ │ ├── gotest
│ │ │ │ └── utils.go
│ │ │ │ ├── discovery.go
│ │ │ │ └── focused_execution_test.go
│ │ ├── daaku
│ │ │ └── go.zipexe
│ │ │ │ └── readme.md
│ │ ├── mattn
│ │ │ └── go-sqlite3
│ │ │ │ ├── sqlite3_other.go
│ │ │ │ ├── sqlite3_windows.go
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── backup.go
│ │ │ │ └── README.mkd
│ │ ├── andybons
│ │ │ └── hipchat
│ │ │ │ ├── initrepo.sh
│ │ │ │ ├── githooks
│ │ │ │ └── pre-commit
│ │ │ │ ├── .gitignore
│ │ │ │ ├── examples
│ │ │ │ └── main.go
│ │ │ │ ├── message.go
│ │ │ │ ├── room.go
│ │ │ │ ├── LICENSE.txt
│ │ │ │ └── README.md
│ │ ├── drone
│ │ │ ├── go-github
│ │ │ │ └── github
│ │ │ │ │ ├── orgs_test.go
│ │ │ │ │ ├── orgs.go
│ │ │ │ │ ├── emails_test.go
│ │ │ │ │ ├── github.go
│ │ │ │ │ ├── users_test.go
│ │ │ │ │ ├── github_test.go
│ │ │ │ │ └── repos_test.go
│ │ │ └── go-bitbucket
│ │ │ │ ├── bitbucket
│ │ │ │ ├── contents_test.go
│ │ │ │ ├── teams_test.go
│ │ │ │ ├── emails_test.go
│ │ │ │ ├── repos_test.go
│ │ │ │ ├── users_test.go
│ │ │ │ ├── bitbucket.go
│ │ │ │ ├── contents.go
│ │ │ │ ├── keys_test.go
│ │ │ │ ├── teams.go
│ │ │ │ └── repo_keys_test.go
│ │ │ │ └── oauth1
│ │ │ │ └── LICENSE
│ │ ├── fluffle
│ │ │ └── goirc
│ │ │ │ └── client
│ │ │ │ └── line_test.go
│ │ └── davecgh
│ │ │ └── go-spew
│ │ │ └── spew
│ │ │ └── dumpnocgo_test.go
│ │ ├── launchpad.net
│ │ └── goyaml
│ │ │ ├── .lbox
│ │ │ ├── suite_test.go
│ │ │ ├── .bzrignore
│ │ │ ├── .lbox.check
│ │ │ ├── Makefile
│ │ │ └── LICENSE.libyaml
│ │ ├── code.google.com
│ │ └── p
│ │ │ ├── go.crypto
│ │ │ ├── ssh
│ │ │ │ ├── test
│ │ │ │ │ ├── doc.go
│ │ │ │ │ └── tcpip_test.go
│ │ │ │ ├── terminal
│ │ │ │ │ ├── util_linux.go
│ │ │ │ │ └── util_bsd.go
│ │ │ │ ├── tcpip_test.go
│ │ │ │ ├── doc.go
│ │ │ │ ├── client_test.go
│ │ │ │ └── kex_test.go
│ │ │ └── bcrypt
│ │ │ │ └── base64.go
│ │ │ ├── go.text
│ │ │ ├── unicode
│ │ │ │ └── norm
│ │ │ │ │ ├── norm_test.go
│ │ │ │ │ ├── Makefile
│ │ │ │ │ └── maketesttables.go
│ │ │ └── transform
│ │ │ │ └── examples_test.go
│ │ │ ├── go.net
│ │ │ └── websocket
│ │ │ │ ├── examplehandler_test.go
│ │ │ │ └── exampledial_test.go
│ │ │ └── gomock
│ │ │ └── gomock
│ │ │ └── mock_matcher
│ │ │ └── mock_matcher.go
│ │ └── bitbucket.org
│ │ └── kardianos
│ │ └── osext
│ │ ├── osext_plan9.go
│ │ ├── osext_procfs.go
│ │ ├── osext_windows.go
│ │ ├── LICENSE
│ │ └── osext.go
└── Readme
├── pkg
├── plugin
│ ├── notify
│ │ ├── zapier.go
│ │ ├── email.go
│ │ └── notification.go
│ ├── publish
│ │ ├── gems.go
│ │ ├── maven.go
│ │ ├── npm.go
│ │ ├── pub.go
│ │ ├── bintray.go
│ │ ├── dropbox.go
│ │ └── publish.go
│ ├── report
│ │ └── README.md
│ └── deploy
│ │ ├── appfog.go
│ │ ├── openshift.go
│ │ ├── engineyard.go
│ │ ├── cloudcontrol.go
│ │ ├── cloudfoundry.go
│ │ ├── bash.go
│ │ ├── modulus.go
│ │ ├── nodejitsu.go
│ │ ├── tsuru.go
│ │ ├── heroku.go
│ │ └── git.go
├── template
│ ├── pages
│ │ ├── 403.html
│ │ ├── 500.html
│ │ ├── 404.html
│ │ ├── forgot.html
│ │ ├── reset.html
│ │ ├── forgot_sent.html
│ │ ├── login_error.html
│ │ ├── register.html
│ │ ├── login.html
│ │ ├── install.html
│ │ ├── github_link.html
│ │ ├── bitbucket_link.html
│ │ ├── form.html
│ │ └── admin_users.html
│ └── emails
│ │ ├── reset_password.html
│ │ ├── activation.html
│ │ └── invitation.html
├── database
│ ├── migrate
│ │ ├── all.go
│ │ ├── 201402200603_rename_privelege_to_privilege.go
│ │ ├── 20140310104446_add_open_invitation_column.go
│ │ ├── 201402211147_github_enterprise_support.go
│ │ ├── util.go
│ │ ├── 20140328201430_add_gitlab_columns.go
│ │ └── migration
│ └── database.go
├── model
│ ├── util_test.go
│ ├── settings_test.go
│ └── member.go
├── build
│ ├── writer_test.go
│ ├── proxy
│ │ ├── proxy_test.go
│ │ └── proxy.go
│ ├── git
│ │ ├── git.go
│ │ └── git_test.go
│ ├── dockerfile
│ │ └── dockerfile.go
│ ├── util_test.go
│ ├── writer.go
│ ├── docker
│ │ └── client_test.go
│ └── buildfile
│ │ └── buildfile_test.go
├── channel
│ └── conn.go
├── queue
│ ├── queue.go
│ └── build_runner.go
└── handler
│ └── builds.go
├── deb
└── drone
│ ├── DEBIAN
│ ├── conffiles
│ ├── control
│ ├── prerm
│ └── postinst
│ └── etc
│ ├── default
│ └── drone
│ └── init
│ └── drone.conf
├── bin
└── README.md
├── cmd
└── droned
│ └── assets
│ ├── img
│ ├── favicon.ico
│ ├── favicon.png
│ ├── build_none.png
│ ├── build_failing.png
│ ├── build_success.png
│ └── build_unknown.png
│ └── test
│ ├── lib
│ └── jasmine-2.0.0
│ │ └── jasmine_favicon.png
│ ├── SpecRunner.html
│ └── line_formatter_test.js
├── .gitmodules
├── .gitignore
├── AUTHORS
├── .drone.yml
└── Dockerfile
/Godeps/_workspace/.gitignore:
--------------------------------------------------------------------------------
1 | /pkg
2 | /bin
3 |
--------------------------------------------------------------------------------
/pkg/plugin/notify/zapier.go:
--------------------------------------------------------------------------------
1 | package notify
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/gems.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/maven.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/npm.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/pub.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/bintray.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/dropbox.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/testdata/fs/a/d:
--------------------------------------------------------------------------------
1 | /b
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/russross/meddler/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/testdata/fs/a/e:
--------------------------------------------------------------------------------
1 | ../b
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/testdata/fs/b/h:
--------------------------------------------------------------------------------
1 | ../g
--------------------------------------------------------------------------------
/deb/drone/DEBIAN/conffiles:
--------------------------------------------------------------------------------
1 | /etc/init/drone.conf
2 | /etc/default/drone
3 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/.lbox:
--------------------------------------------------------------------------------
1 | propose -cr -for=lp:goyaml
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/testdata/fs/a/f:
--------------------------------------------------------------------------------
1 | ../../../../test
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/bmizerany/pat/.gitignore:
--------------------------------------------------------------------------------
1 | *.prof
2 | *.out
3 | example/example
4 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/Godeps:
--------------------------------------------------------------------------------
1 | github.com/stretchr/testify master
--------------------------------------------------------------------------------
/bin/README.md:
--------------------------------------------------------------------------------
1 | This is where Drone binaries go after running `make` in the Drone root directory.
--------------------------------------------------------------------------------
/pkg/plugin/report/README.md:
--------------------------------------------------------------------------------
1 | cobertura.go
2 | coveralls.go
3 | gocov.go
4 | junit.go
5 | phpunit.go
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/.gitignore:
--------------------------------------------------------------------------------
1 | /gen/gen
2 | /example/example
3 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/example/example-files/file.txt:
--------------------------------------------------------------------------------
1 | test content
2 | break
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/testdata/fs/g:
--------------------------------------------------------------------------------
1 | ../../../../../../../../../../../../root
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/embedded-a.go:
--------------------------------------------------------------------------------
1 | package rice
2 |
3 | //++ object embedding
4 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | examples/config.json
--------------------------------------------------------------------------------
/cmd/droned/assets/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/favicon.ico
--------------------------------------------------------------------------------
/cmd/droned/assets/img/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/favicon.png
--------------------------------------------------------------------------------
/cmd/droned/assets/img/build_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/build_none.png
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jacobsa/oglematchers/.gitignore:
--------------------------------------------------------------------------------
1 | *.6
2 | 6.out
3 | _obj/
4 | _test/
5 | _testmain.go
6 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/small.txt:
--------------------------------------------------------------------------------
1 | Kilts
--------------------------------------------------------------------------------
/cmd/droned/assets/img/build_failing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/build_failing.png
--------------------------------------------------------------------------------
/cmd/droned/assets/img/build_success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/build_success.png
--------------------------------------------------------------------------------
/cmd/droned/assets/img/build_unknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/img/build_unknown.png
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/example/example-templates/message.tmpl:
--------------------------------------------------------------------------------
1 | I have a message for you: {{.Message}}
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/archive/MAINTAINERS:
--------------------------------------------------------------------------------
1 | Michael Crosby (@crosbymichael)
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/uniuri/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.0
5 | - 1.1
6 | - 1.2
7 | - tip
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/small2.txt:
--------------------------------------------------------------------------------
1 | Google.com
2 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/debug.go:
--------------------------------------------------------------------------------
1 | package rice
2 |
3 | // Debug can be set to true to enable debugging.
4 | var Debug = false
5 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/termsize_linux.go:
--------------------------------------------------------------------------------
1 | // +build linux
2 |
3 | package flags
4 |
5 | const (
6 | tIOCGWINSZ = 0x5413
7 | )
8 |
--------------------------------------------------------------------------------
/cmd/droned/assets/test/lib/jasmine-2.0.0/jasmine_favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/cmd/droned/assets/test/lib/jasmine-2.0.0/jasmine_favicon.png
--------------------------------------------------------------------------------
/Godeps/Readme:
--------------------------------------------------------------------------------
1 | This directory tree is generated automatically by godep.
2 |
3 | Please do not edit.
4 |
5 | See https://github.com/tools/godep for more information.
6 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/go-sql-driver/mysql/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .DS_Store?
3 | ._*
4 | .Spotlight-V100
5 | .Trashes
6 | Icon?
7 | ehthumbs.db
8 | Thumbs.db
9 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vendor/src/github.com/GeertJohan/go.rice"]
2 | path = vendor/src/github.com/GeertJohan/go.rice
3 | url = https://github.com/GeertJohan/go.rice.git
4 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/term/MAINTAINERS:
--------------------------------------------------------------------------------
1 | Guillaume J. Charmes (@creack)
2 | Solomon Hykes (@shykes)
3 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/go-sql-driver/mysql/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.1
4 | - tip
5 |
6 | before_script:
7 | - mysql -e 'create database gotest;'
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/.gitignore:
--------------------------------------------------------------------------------
1 | /example/example
2 | /example/example.exe
3 | /rice/rice
4 | /rice/rice.exe
5 |
6 | *.rice-box.go
7 | *.rice-single.go
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/termsize_unix.go:
--------------------------------------------------------------------------------
1 | // +build darwin freebsd netbsd openbsd
2 |
3 | package flags
4 |
5 | const (
6 | tIOCGWINSZ = 0x40087468
7 | )
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/termsize_other.go:
--------------------------------------------------------------------------------
1 | // +build !darwin,!freebsd,!netbsd,!openbsd,!linux
2 |
3 | package flags
4 |
5 | const (
6 | tIOCGWINSZ = 0
7 | )
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/examples/config.json.sample:
--------------------------------------------------------------------------------
1 | {
2 | "host": "https://gitlab.domain.com",
3 | "api_path": "/api/v3",
4 | "token": "TOKEN"
5 | }
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/termsize_nosysioctl.go:
--------------------------------------------------------------------------------
1 | // +build windows plan9 solaris
2 |
3 | package flags
4 |
5 | func getTerminalColumns() int {
6 | return 80
7 | }
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/init.go:
--------------------------------------------------------------------------------
1 | package assertions
2 |
3 | var serializer Serializer
4 |
5 | func init() {
6 | serializer = newSerializer()
7 | }
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.1
4 | - 1.2
5 | install:
6 | - go get github.com/stretchr/testify/assert
7 | script:
8 | - go test -v
--------------------------------------------------------------------------------
/pkg/template/pages/403.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Forbidden · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Forbidden
5 | Forbidden
6 | {{ end }}
7 |
8 | {{ define "script" }}
9 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/example/example-files/img/doge.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/Godeps/_workspace/src/github.com/GeertJohan/go.rice/example/example-files/img/doge.jpg
--------------------------------------------------------------------------------
/pkg/template/pages/500.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Bad Request · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Bad Request
5 | Bad Request
6 | {{ end }}
7 |
8 | {{ define "script" }}
9 | {{ end }}
--------------------------------------------------------------------------------
/deb/drone/DEBIAN/control:
--------------------------------------------------------------------------------
1 | Package: drone
2 | Version: 0.1
3 | Section: base
4 | Priority: optional
5 | Architecture: amd64
6 | Maintainer: Brad Rydzewski
7 | Description: Drone continuous integration server
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/daaku/go.zipexe/readme.md:
--------------------------------------------------------------------------------
1 | go.zipexe
2 | =========
3 |
4 | This module was taken as-is from https://github.com/cookieo9/resources-go.
5 | Documentation: http://godoc.org/github.com/daaku/go.zipexe
6 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/appfog.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type AppFog struct {
8 | }
9 |
10 | func (a *AppFog) Write(f *buildfile.Buildfile) {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/template/pages/404.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Not Found · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Oops!
5 | We were unable to find the requested page.
6 | {{ end }}
7 |
8 | {{ define "script" }}
9 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/errors.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "errors"
5 | )
6 |
7 | var (
8 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported")
9 | )
10 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go:
--------------------------------------------------------------------------------
1 | // +build !windows
2 |
3 | package sqlite3
4 |
5 | /*
6 | #cgo CFLAGS: -I.
7 | #cgo linux LDFLAGS: -ldl
8 | #cgo CFLAGS: -DSQLITE_ENABLE_RTREE
9 | */
10 | import "C"
11 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/openshift.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type Openshift struct {
8 | }
9 |
10 | func (o *Openshift) Write(f *buildfile.Buildfile) {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/engineyard.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type EngineYard struct {
8 | }
9 |
10 | func (e *EngineYard) Write(f *buildfile.Buildfile) {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/cloudcontrol.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type CloudControl struct {
8 | }
9 |
10 | func (c *CloudControl) Write(f *buildfile.Buildfile) {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/cloudfoundry.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type CloudFoundry struct {
8 | }
9 |
10 | func (c *CloudFoundry) Write(f *buildfile.Buildfile) {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/doc.go:
--------------------------------------------------------------------------------
1 | // Package assertions contains the implementations for all assertions which
2 | // are referenced in the convey package for use with the So(...) method.
3 | package assertions
4 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/suite_test.go:
--------------------------------------------------------------------------------
1 | package goyaml_test
2 |
3 | import (
4 | . "launchpad.net/gocheck"
5 | "testing"
6 | )
7 |
8 | func Test(t *testing.T) { TestingT(t) }
9 |
10 | type S struct{}
11 |
12 | var _ = Suite(&S{})
13 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/v7.tar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/v7.tar
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go:
--------------------------------------------------------------------------------
1 | package sqlite3
2 |
3 | /*
4 | #cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
5 | #cgo LDFLAGS: -lmingwex -lmingw32
6 | #cgo CFLAGS: -DSQLITE_ENABLE_RTREE
7 | */
8 | import "C"
9 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/writer-big.tar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fd/drone/master/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/writer-big.tar
--------------------------------------------------------------------------------
/deb/drone/etc/default/drone:
--------------------------------------------------------------------------------
1 | # Upstart configuration file for droned.
2 |
3 | # Command line options:
4 | #
5 | # -datasource="drone.sqlite":
6 | # -driver="sqlite3":
7 | # -path="":
8 | # -port=":8080":
9 | # -workers="4":
10 | #
11 | #DRONED_OPTS="--port=:80"
12 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/.bzrignore:
--------------------------------------------------------------------------------
1 | [568].out
2 | _*
3 | *.cgo*.*
4 |
5 | yaml-*/stamp-h1
6 | yaml-*/Makefile
7 | yaml-*/*/Makefile
8 | yaml-*/libtool
9 | yaml-*/config*
10 | yaml-*/*/*.lo
11 | yaml-*/*/*.la
12 | yaml-*/*/.libs
13 | yaml-*/*/.deps
14 | yaml-*/tests/*
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | drone.sublime-project
2 | drone.sublime-workspace
3 | *~
4 | ~*
5 | *.sqlite
6 | *.deb
7 | *.rice-box.go
8 |
9 | bin/drone
10 | bin/droned
11 | cmd/drone/drone
12 | cmd/droned/droned
13 | deb/drone/usr/local/bin/drone
14 | deb/drone/usr/local/bin/droned
15 |
16 | .vagrant
17 | *.out
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | # This file lists all individuals having contributed content to the repository.
2 | # If you're submitting a patch, please add your name here in alphabetical order as part of the patch.
3 |
4 | Artur Rodrigues
5 | Brad Rydzewski
6 | Thomas Burke
7 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/hooks/show.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 1,
3 | "url": "http://example.com/hook",
4 | "project_id": 3,
5 | "push_events": "true",
6 | "issues_events": "true",
7 | "merge_requests_events": "true",
8 | "created_at": "2012-10-12T17:04:47Z"
9 | }
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/doc.go:
--------------------------------------------------------------------------------
1 |
2 | // package incremental provides concurency-safe incremental numbers.
3 | //
4 | // This package was created by a simple piece of code located in the gen subdirectory. Please modify that command if you want to modify this package.
5 | package incremental
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/initrepo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Create symlinks to all git hooks in your own .git dir.
4 | echo "### Creating symlinks to our git hooks..."
5 | for f in $(ls -d githooks/*)
6 | do ln -s ../../$f .git/hooks
7 | done && ls -al .git/hooks | grep githooks
8 | echo ""
9 |
--------------------------------------------------------------------------------
/deb/drone/etc/init/drone.conf:
--------------------------------------------------------------------------------
1 | start on (filesystem and net-device-up)
2 |
3 | chdir /var/lib/drone
4 | console log
5 |
6 | script
7 | DRONED_OPTS="--port=:80"
8 | if [ -f /etc/default/$UPSTART_JOB ]; then
9 | . /etc/default/$UPSTART_JOB
10 | fi
11 | droned $DRONED_OPTS
12 | end script
13 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/githooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Exit on error.
4 | set -e
5 |
6 | echo "Running go vet..."
7 | go vet hipchat/...
8 |
9 | echo "Running tests..."
10 | go test hipchat/...
11 |
12 | echo "Running gofmt..."
13 | find . -name "*.go" | xargs gofmt -w
14 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/orgs_test.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Orgs(t *testing.T) {
8 |
9 | // Get the currently authenticated user
10 | _, err := client.Orgs.List()
11 | if err != nil {
12 | t.Error(err)
13 | return
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux
2 |
3 | package system
4 |
5 | import (
6 | "os/exec"
7 | )
8 |
9 | func SetCloneFlags(cmd *exec.Cmd, flag uintptr) {
10 |
11 | }
12 |
13 | func UsetCloseOnExec(fd uintptr) error {
14 | return ErrNotSupportedPlatform
15 | }
16 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/stat_linux.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "syscall"
5 | )
6 |
7 | func GetLastAccess(stat *syscall.Stat_t) syscall.Timespec {
8 | return stat.Atim
9 | }
10 |
11 | func GetLastModification(stat *syscall.Stat_t) syscall.Timespec {
12 | return stat.Mtim
13 | }
14 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - tip
4 | before_install:
5 | - go get github.com/axw/gocov/gocov
6 | - go get github.com/mattn/goveralls
7 | - go get code.google.com/p/go.tools/cmd/cover
8 | script:
9 | - $HOME/gopath/bin/goveralls -repotoken 3qJVUE0iQwqnCbmNcDsjYu1nh4J4KIFXx
10 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/doc.go:
--------------------------------------------------------------------------------
1 | // Package reporting contains internal functionality related
2 | // to console reporting and output. Although this package has
3 | // exported names is not intended for public consumption. See the
4 | // examples package for how to use this project.
5 | package reporting
6 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/test/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This package contains integration tests for the
6 | // code.google.com/p/go.crypto/ssh package.
7 | package test
8 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/public_keys/show.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 1,
3 | "title": "Public key",
4 | "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
5 | }
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/uname_unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux !amd64
2 |
3 | package utils
4 |
5 | import (
6 | "errors"
7 | )
8 |
9 | type Utsname struct {
10 | Release [65]byte
11 | }
12 |
13 | func uname() (*Utsname, error) {
14 | return nil, errors.New("Kernel version detection is available only on linux")
15 | }
16 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/stat_unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux
2 |
3 | package system
4 |
5 | import "syscall"
6 |
7 | func GetLastAccess(stat *syscall.Stat_t) syscall.Timespec {
8 | return stat.Atimespec
9 | }
10 |
11 | func GetLastModification(stat *syscall.Stat_t) syscall.Timespec {
12 | return stat.Mtimespec
13 | }
14 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/xattrs_unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux
2 |
3 | package system
4 |
5 | func Lgetxattr(path string, attr string) ([]byte, error) {
6 | return nil, ErrNotSupportedPlatform
7 | }
8 |
9 | func Lsetxattr(path string, attr string, data []byte, flags int) error {
10 | return ErrNotSupportedPlatform
11 | }
12 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/console.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | )
7 |
8 | type console struct{}
9 |
10 | func (self *console) Write(p []byte) (n int, err error) {
11 | return fmt.Print(string(p))
12 | }
13 |
14 | func NewConsole() io.Writer {
15 | return new(console)
16 | }
17 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/rice/identifier.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/GeertJohan/go.incremental"
5 | "strconv"
6 | )
7 |
8 | var identifierCount incremental.Uint64
9 |
10 | func nextIdentifier() string {
11 | num := identifierCount.Next()
12 | return strconv.FormatUint(num, 36) // 0123456789abcdefghijklmnopqrstuvwxyz
13 | }
14 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/utimes_unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux
2 |
3 | package system
4 |
5 | import "syscall"
6 |
7 | func LUtimesNano(path string, ts []syscall.Timespec) error {
8 | return ErrNotSupportedPlatform
9 | }
10 |
11 | func UtimesNano(path string, ts []syscall.Timespec) error {
12 | return ErrNotSupportedPlatform
13 | }
14 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/random.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "crypto/rand"
5 | "encoding/hex"
6 | "io"
7 | )
8 |
9 | func RandomString() string {
10 | id := make([]byte, 32)
11 | _, err := io.ReadFull(rand.Reader, id)
12 | if err != nil {
13 | panic(err) // This shouldn't happen
14 | }
15 | return hex.EncodeToString(id)
16 | }
17 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/uname_linux.go:
--------------------------------------------------------------------------------
1 | // +build amd64
2 |
3 | package utils
4 |
5 | import (
6 | "syscall"
7 | )
8 |
9 | type Utsname syscall.Utsname
10 |
11 | func uname() (*syscall.Utsname, error) {
12 | uts := &syscall.Utsname{}
13 |
14 | if err := syscall.Uname(uts); err != nil {
15 | return nil, err
16 | }
17 | return uts, nil
18 | }
19 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/terminal/util_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux
6 |
7 | package terminal
8 |
9 | import "syscall"
10 |
11 | const ioctlReadTermios = syscall.TCGETS
12 | const ioctlWriteTermios = syscall.TCSETS
13 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/passwordreset/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 |
24 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/terminal/util_bsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin
6 |
7 | package terminal
8 |
9 | import "syscall"
10 |
11 | const ioctlReadTermios = syscall.TIOCGETA
12 | const ioctlWriteTermios = syscall.TIOCSETA
13 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 |
24 | .DS_Store
25 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/bash.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type Bash struct {
8 | Script []string `yaml:"script,omitempty"`
9 | Command string `yaml:"command,omitempty"`
10 | }
11 |
12 | func (g *Bash) Write(f *buildfile.Buildfile) {
13 | g.Script = append(g.Script, g.Command)
14 |
15 | for _, cmd := range g.Script {
16 | f.WriteCmd(cmd)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/users/show.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 6,
3 | "username": "plouc",
4 | "email": "plouc@plouc.com",
5 | "name": "Raphaël Benitte",
6 | "bio": null,
7 | "skype": "",
8 | "linkedin": "",
9 | "twitter": "",
10 | "theme_id": 2,
11 | "state": "active",
12 | "created_at": "2001-01-01T00:00:00Z",
13 | "extern_uid": "uid=plouc",
14 | "provider": "ldap"
15 | }
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/tcpip_test.go:
--------------------------------------------------------------------------------
1 | package ssh
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestAutoPortListenBroken(t *testing.T) {
8 | broken := "SSH-2.0-OpenSSH_5.9hh11"
9 | works := "SSH-2.0-OpenSSH_6.1"
10 | if !isBrokenOpenSSHVersion(broken) {
11 | t.Errorf("version %q not marked as broken", broken)
12 | }
13 | if isBrokenOpenSSHVersion(works) {
14 | t.Errorf("version %q marked as broken", works)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.text/unicode/norm/norm_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package norm_test
6 |
7 | import (
8 | "testing"
9 | )
10 |
11 | func TestPlaceHolder(t *testing.T) {
12 | // Does nothing, just allows the Makefile to be canonical
13 | // while waiting for the package itself to be written.
14 | }
15 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/helper_test.go:
--------------------------------------------------------------------------------
1 | package gogitlab
2 |
3 | import (
4 | "io/ioutil"
5 | "net/http"
6 | "net/http/httptest"
7 | )
8 |
9 | func Stub(filename string) (*httptest.Server, *Gitlab) {
10 | stub, _ := ioutil.ReadFile(filename)
11 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
12 | w.Write([]byte(stub))
13 | }))
14 | gitlab := NewGitlab(ts.URL, "", "")
15 | return ts, gitlab
16 | }
17 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/check_crosscompile.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | echo '# linux arm7'
6 | GOARM=7 GOARCH=arm GOOS=linux go build
7 | echo '# linux arm5'
8 | GOARM=5 GOARCH=arm GOOS=linux go build
9 | echo '# windows 386'
10 | GOARCH=386 GOOS=windows go build
11 | echo '# windows amd64'
12 | GOARCH=amd64 GOOS=windows go build
13 | echo '# darwin'
14 | GOARCH=amd64 GOOS=darwin go build
15 | echo '# freebsd'
16 | GOARCH=amd64 GOOS=freebsd go build
17 |
--------------------------------------------------------------------------------
/pkg/template/pages/forgot.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Forgot Password?{{ end }}
2 |
3 | {{ define "content" }}
4 | Forgot Password
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 | {{ end }}
15 |
16 | {{ define "script" }}
17 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/orgs.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | type Org struct {
4 | Login string `json:"login"`
5 | Url string `json:"url"`
6 | Avatar string `json:"avatar_url"`
7 | }
8 |
9 | type OrgResource struct {
10 | client *Client
11 | }
12 |
13 | func (r *OrgResource) List() ([]*Org, error) {
14 | orgs := []*Org{}
15 | if err := r.client.do("GET", "/user/orgs", nil, &orgs); err != nil {
16 | return nil, err
17 | }
18 |
19 | return orgs, nil
20 | }
21 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/bitbucket.org/kardianos/osext/osext_plan9.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package osext
6 |
7 | import "syscall"
8 |
9 | func executable() (string, error) {
10 | f, err := Open("/proc/" + itoa(Getpid()) + "/text")
11 | if err != nil {
12 | return "", err
13 | }
14 | defer f.Close()
15 | return syscall.Fd2path(int(f.Fd()))
16 | }
17 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/checksum.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "encoding/hex"
5 | "hash"
6 | "io"
7 | )
8 |
9 | type CheckSum struct {
10 | io.Reader
11 | Hash hash.Hash
12 | }
13 |
14 | func (cs *CheckSum) Read(buf []byte) (int, error) {
15 | n, err := cs.Reader.Read(buf)
16 | if err == nil {
17 | cs.Hash.Write(buf[:n])
18 | }
19 | return n, err
20 | }
21 |
22 | func (cs *CheckSum) Sum() string {
23 | return hex.EncodeToString(cs.Hash.Sum(nil))
24 | }
25 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/bmizerany/pat/bench_test.go:
--------------------------------------------------------------------------------
1 | package pat
2 |
3 | import (
4 | "net/http"
5 | "testing"
6 | )
7 |
8 | func BenchmarkPatternMatching(b *testing.B) {
9 | p := New()
10 | p.Get("/hello/:name", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
11 | for n := 0; n < b.N; n++ {
12 | b.StopTimer()
13 | r, err := http.NewRequest("GET", "/hello/blake", nil)
14 | if err != nil {
15 | panic(err)
16 | }
17 | b.StartTimer()
18 | p.ServeHTTP(nil, r)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/deb/drone/DEBIAN/prerm:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 | set -u
5 |
6 | case "$1" in
7 | remove|remove-in-favour|deconfigure|deconfigure-in-favour)
8 | if [ -f /etc/init/drone.conf ]; then
9 | echo "Stopping drone ..."
10 | service drone stop || exit $?
11 | echo "Drone Stopped."
12 | fi
13 | ;;
14 |
15 | upgrade|failed-upgrade)
16 | ;;
17 |
18 | *)
19 | echo "prerm called with unknown argument \`$1'" >&2
20 | exit 1
21 | ;;
22 | esac
23 |
24 | #DEBHELPER#
25 |
26 | exit 0
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/.lbox.check:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | BADFMT=`find * -name '*.go' | xargs gofmt -l`
6 | if [ -n "$BADFMT" ]; then
7 | BADFMT=`echo "$BADFMT" | sed "s/^/ /"`
8 | echo -e "gofmt is sad:\n\n$BADFMT"
9 | exit 1
10 | fi
11 |
12 | VERSION=`go version | awk '{print $3}'`
13 | if [ $VERSION == 'devel' ]; then
14 | go tool vet \
15 | -methods \
16 | -printf \
17 | -rangeloops \
18 | -printfuncs 'ErrorContextf:1,notFoundf:0,badReqErrorf:0,Commitf:0,Snapshotf:0,Debugf:0' \
19 | .
20 | fi
21 |
--------------------------------------------------------------------------------
/deb/drone/DEBIAN/postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | case "$1" in
5 | abort-upgrade|abort-remove|abort-deconfigure|configure)
6 | ;;
7 |
8 | *)
9 | echo "postinst called with unknown argument \`$1'" >&2
10 | exit 1
11 | ;;
12 | esac
13 |
14 | echo "Starting drone ..."
15 | if [ -f /etc/init/drone.conf ]; then
16 | if pidof /usr/local/bin/droned >/dev/null; then
17 | service drone stop || exit $?
18 | fi
19 | service drone start && echo "Drone started."
20 | fi
21 |
22 | #DEBHELPER#
23 |
24 | exit 0
25 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/termsize.go:
--------------------------------------------------------------------------------
1 | // +build !windows,!plan9,!solaris
2 |
3 | package flags
4 |
5 | import (
6 | "syscall"
7 | "unsafe"
8 | )
9 |
10 | type winsize struct {
11 | row, col uint16
12 | xpixel, ypixel uint16
13 | }
14 |
15 | func getTerminalColumns() int {
16 | ws := winsize{}
17 |
18 | if tIOCGWINSZ != 0 {
19 | syscall.Syscall(syscall.SYS_IOCTL,
20 | uintptr(0),
21 | uintptr(tIOCGWINSZ),
22 | uintptr(unsafe.Pointer(&ws)))
23 |
24 | return int(ws.col)
25 | }
26 |
27 | return 80
28 | }
29 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/gitlab_test.go:
--------------------------------------------------------------------------------
1 | package gogitlab
2 |
3 | import (
4 | "github.com/stretchr/testify/assert"
5 | "testing"
6 | )
7 |
8 | func TestResourceUrl(t *testing.T) {
9 | gitlab := NewGitlab("http://base_url/", "api_path", "token")
10 |
11 | assert.Equal(t, gitlab.ResourceUrl(projects_url, nil), "http://base_url/api_path/projects?private_token=token")
12 | assert.Equal(t, gitlab.ResourceUrl(project_url, map[string]string{":id": "123"}), "http://base_url/api_path/projects/123?private_token=token")
13 | }
14 |
--------------------------------------------------------------------------------
/pkg/database/migrate/all.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | // All is called to collect all migration scripts
4 | // and adds them to Revision list. New Revision
5 | // should be added here ordered by its revision
6 | // number.
7 | func (m *Migration) All() *Migration {
8 |
9 | // List all migrations here
10 | m.Add(SetupTables)
11 | m.Add(SetupIndices)
12 | m.Add(RenamePrivelegedToPrivileged)
13 | m.Add(GitHubEnterpriseSupport)
14 | m.Add(AddOpenInvitationColumn)
15 | m.Add(AddGitlabColumns)
16 |
17 | // m.Add(...)
18 | // ...
19 | return m
20 | }
21 |
--------------------------------------------------------------------------------
/pkg/template/pages/reset.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Reset · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Reset Password
5 | {{ if .Error }}
6 | {{ .Error }}
7 | {{ end }}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 | {{ end }}
18 |
19 | {{ define "script" }}
20 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/examples/add.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | type AddCommand struct {
8 | All bool `short:"a" long:"all" description:"Add all files"`
9 | }
10 |
11 | var addCommand AddCommand
12 |
13 | func (x *AddCommand) Execute(args []string) error {
14 | fmt.Printf("Adding (all=%v): %#v\n", x.All, args)
15 | return nil
16 | }
17 |
18 | func init() {
19 | parser.AddCommand("add",
20 | "Add a file",
21 | "The add command adds a file to the repository. Use -a to add all files.",
22 | &addCommand)
23 | }
24 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/users/current.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 1,
3 | "username": "john_smith",
4 | "email": "john@example.com",
5 | "name": "John Smith",
6 | "private_token": "dd34asd13as",
7 | "state": "active",
8 | "created_at": "2012-05-23T08:00:58Z",
9 | "bio": null,
10 | "skype": "",
11 | "linkedin": "",
12 | "twitter": "",
13 | "website_url": "",
14 | "theme_id": 1,
15 | "color_scheme_id": 2,
16 | "is_admin": false,
17 | "can_create_group": true,
18 | "can_create_project": true
19 | }
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/archive/stat_unsupported.go:
--------------------------------------------------------------------------------
1 | // +build !linux !amd64
2 |
3 | package archive
4 |
5 | import "syscall"
6 |
7 | func getLastAccess(stat *syscall.Stat_t) syscall.Timespec {
8 | return syscall.Timespec{}
9 | }
10 |
11 | func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
12 | return syscall.Timespec{}
13 | }
14 |
15 | func LUtimesNano(path string, ts []syscall.Timespec) error {
16 | return ErrNotImplemented
17 | }
18 |
19 | func UtimesNano(path string, ts []syscall.Timespec) error {
20 | return ErrNotImplemented
21 | }
22 |
--------------------------------------------------------------------------------
/pkg/model/util_test.go:
--------------------------------------------------------------------------------
1 | package model
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_createSlug(t *testing.T) {
8 | strings := map[string]string{
9 | "John Tyler": "john-tyler",
10 | "James K. Polk": "james-k-polk",
11 | "George H. W. Bush": "george-h-w-bush",
12 | "François Hollande": "francois-hollande",
13 | "dàzǒngtǒng": "dazongtong",
14 | "大總統": "大總統",
15 | }
16 |
17 | for k, v := range strings {
18 | if slug := createSlug(k); slug != v {
19 | t.Errorf("Expected Slug %s for string %s, got %s", v, k, slug)
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/hooks/issue.json:
--------------------------------------------------------------------------------
1 | {
2 | "object_kind": "issue",
3 | "object_attributes": {
4 | "id": 301,
5 | "title": "New API: create/update/delete file",
6 | "assignee_id": 51,
7 | "author_id": 51,
8 | "project_id": 14,
9 | "created_at": "2013-12-03T17:15:43Z",
10 | "updated_at": "2013-12-03T17:15:43Z",
11 | "position": 0,
12 | "branch_name": null,
13 | "description": "Create new API for manipulations with repository",
14 | "milestone_id": null,
15 | "state": "opened",
16 | "iid": 23
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/stat_atim.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux dragonfly openbsd solaris
6 |
7 | package tar
8 |
9 | import (
10 | "syscall"
11 | "time"
12 | )
13 |
14 | func statAtime(st *syscall.Stat_t) time.Time {
15 | return time.Unix(st.Atim.Unix())
16 | }
17 |
18 | func statCtime(st *syscall.Stat_t) time.Time {
19 | return time.Unix(st.Ctim.Unix())
20 | }
21 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/contents_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "fmt"
5 | "testing"
6 | )
7 |
8 | func Test_Contents(t *testing.T) {
9 |
10 | const testFile = "readme.rst"
11 | const testRev = "8f0fe25998516f460ce2a2a867b7298b3628dd23"
12 |
13 | // GET the latest revision for the repo
14 |
15 | // GET the README file for the repo & revision
16 | src, err := client.Sources.Find("atlassian", "jetbrains-bitbucket-connector", testRev, testFile)
17 | if err != nil {
18 | t.Error(err)
19 | return
20 | }
21 |
22 | fmt.Println(src)
23 | }
24 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/examples/rm.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | type RmCommand struct {
8 | Force bool `short:"f" long:"force" description:"Force removal of files"`
9 | }
10 |
11 | var rmCommand RmCommand
12 |
13 | func (x *RmCommand) Execute(args []string) error {
14 | fmt.Printf("Removing (force=%v): %#v\n", x.Force, args)
15 | return nil
16 | }
17 |
18 | func init() {
19 | parser.AddCommand("rm",
20 | "Remove a file",
21 | "The rm command removes a file to the repository. Use -f to force removal of files.",
22 | &rmCommand)
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/database/migrate/201402200603_rename_privelege_to_privilege.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | type Rev1 struct{}
4 |
5 | var RenamePrivelegedToPrivileged = &Rev1{}
6 |
7 | func (r *Rev1) Revision() int64 {
8 | return 201402200603
9 | }
10 |
11 | func (r *Rev1) Up(mg *MigrationDriver) error {
12 | _, err := mg.RenameColumns("repos", map[string]string{
13 | "priveleged": "privileged",
14 | })
15 | return err
16 | }
17 |
18 | func (r *Rev1) Down(mg *MigrationDriver) error {
19 | _, err := mg.RenameColumns("repos", map[string]string{
20 | "privileged": "priveleged",
21 | })
22 | return err
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/template/emails/reset_password.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}PASSWORD RESET{{ end }}
2 |
3 | {{ define "content" }}
4 | Please follow this link to activate your account:
5 |
6 |
7 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/stat_atimespec.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin freebsd netbsd
6 |
7 | package tar
8 |
9 | import (
10 | "syscall"
11 | "time"
12 | )
13 |
14 | func statAtime(st *syscall.Stat_t) time.Time {
15 | return time.Unix(st.Atimespec.Unix())
16 | }
17 |
18 | func statCtime(st *syscall.Stat_t) time.Time {
19 | return time.Unix(st.Ctimespec.Unix())
20 | }
21 |
--------------------------------------------------------------------------------
/pkg/template/emails/activation.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}ACCOUNT ACTIVATION{{ end }}
2 |
3 | {{ define "content" }}
4 | Please follow this link to activate your account:
5 |
6 |
7 | {{ end }}
8 |
--------------------------------------------------------------------------------
/pkg/template/pages/forgot_sent.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Forgot Password?{{ end }}
2 |
3 | {{ define "content" }}
4 | Forgot Password
5 | A Password Reset Email was Sent.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 | {{ end }}
16 |
17 | {{ define "script" }}
18 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/russross/meddler/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Meddler is a small toolkit to take some of the tedium out of moving data
3 | back and forth between sql queries and structs.
4 |
5 | It is not a complete ORM. It is intended to be lightweight way to add some
6 | of the convenience of an ORM while leaving more control in the hands of the
7 | programmer.
8 |
9 | Package docs are available at:
10 |
11 | http://godoc.org/github.com/russross/meddler
12 |
13 | The package is housed on github, and the README there has more info:
14 |
15 | http://github.com/russross/meddler
16 |
17 | */
18 | package meddler
19 |
--------------------------------------------------------------------------------
/pkg/plugin/publish/publish.go:
--------------------------------------------------------------------------------
1 | package publish
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | // Publish stores the configuration details
8 | // for publishing build artifacts when
9 | // a Build has succeeded
10 | type Publish struct {
11 | S3 *S3 `yaml:"s3,omitempty"`
12 | Swift *Swift `yaml:"swift,omitempty"`
13 | PyPI *PyPI `yaml:"pypi,omitempty"`
14 | }
15 |
16 | func (p *Publish) Write(f *buildfile.Buildfile) {
17 | if p.S3 != nil {
18 | p.S3.Write(f)
19 | }
20 | if p.Swift != nil {
21 | p.Swift.Write(f)
22 | }
23 | if p.PyPI != nil {
24 | p.PyPI.Write(f)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/http.go:
--------------------------------------------------------------------------------
1 | package rice
2 |
3 | import (
4 | "net/http"
5 | )
6 |
7 | // HTTPBox implements http.FileSystem which allows the use of Box with a http.FileServer.
8 | // e.g.: http.Handle("/", http.FileServer(rice.MustFindBox("http-files").HTTPBox()))
9 | type HTTPBox struct {
10 | *Box
11 | }
12 |
13 | // HTTPBox creates a new HTTPBox from an existing Box
14 | func (b *Box) HTTPBox() *HTTPBox {
15 | return &HTTPBox{b}
16 | }
17 |
18 | // Open returns a File using the http.File interface
19 | func (hb *HTTPBox) Open(name string) (http.File, error) {
20 | return hb.Box.Open(name)
21 | }
22 |
--------------------------------------------------------------------------------
/pkg/template/emails/invitation.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}TEAM INVITATION{{ end }}
2 |
3 | {{ define "content" }}
4 | You are invited to join team {{ .Team.Name }}. Please follow this link to join:
5 |
6 |
7 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/filter.go:
--------------------------------------------------------------------------------
1 | package assertions
2 |
3 | import "fmt"
4 |
5 | const (
6 | success = ""
7 | needExactValues = "This assertion requires exactly %d comparison values (you provided %d)."
8 | )
9 |
10 | func need(needed int, expected []interface{}) string {
11 | if len(expected) != needed {
12 | return fmt.Sprintf(needExactValues, needed, len(expected))
13 | }
14 | return success
15 | }
16 |
17 | func atLeast(minimum int, expected []interface{}) string {
18 | if len(expected) < 1 {
19 | return shouldHaveProvidedCollectionMembers
20 | }
21 | return success
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/template/pages/login_error.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Login · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Login
5 | Invalid Email Address or Password
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 | {{ end }}
17 |
18 | {{ define "script" }}
19 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/rice/util.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "math/rand"
5 | "time"
6 | )
7 |
8 | // randomString generates a pseudo-random alpha-numeric string with given length.
9 | func randomString(length int) string {
10 | rand.Seed(time.Now().UnixNano())
11 | k := make([]rune, length)
12 | for i := 0; i < length; i++ {
13 | c := rand.Intn(35)
14 | if c < 10 {
15 | c += 48 // numbers (0-9) (0+48 == 48 == '0', 9+48 == 57 == '9')
16 | } else {
17 | c += 87 // lower case alphabets (a-z) (10+87 == 97 == 'a', 35+87 == 122 = 'z')
18 | }
19 | k[i] = rune(c)
20 | }
21 | return string(k)
22 | }
23 |
--------------------------------------------------------------------------------
/.drone.yml:
--------------------------------------------------------------------------------
1 | image: go1.2
2 | env:
3 | - GOROOT=/usr/local/go
4 | - GOPATH=$PWD/Godeps/_workspace:/var/cache/drone
5 | - PATH=$PWD/Godeps/_workspace/bin:/var/cache/drone/bin:$PATH
6 | script:
7 | - sudo apt-get -y install libsqlite3-dev sqlite3 1> /dev/null 2> /dev/null
8 | - make embed
9 | - make build-dist
10 | - make test
11 | - make dpkg
12 | notify:
13 | email:
14 | recipients:
15 | - brad@drone.io
16 |
17 | publish:
18 | s3:
19 | acl: public-read
20 | region: us-east-1
21 | bucket: downloads.drone.io
22 | access_key: $AWS_KEY
23 | secret_key: $AWS_SECRET
24 | source: deb/drone.deb
25 | target: latest/
26 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/examples/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "../" // Use github.com/andybons/hipchat for your code.
5 | "log"
6 | )
7 |
8 | func main() {
9 | c := hipchat.Client{AuthToken: ""}
10 | req := hipchat.MessageRequest{
11 | RoomId: "Rat Man’s Den",
12 | From: "GLaDOS",
13 | Message: "Bad news: Combustible lemons failed.",
14 | Color: hipchat.ColorPurple,
15 | MessageFormat: hipchat.FormatText,
16 | Notify: true,
17 | }
18 | if err := c.PostMessage(req); err != nil {
19 | log.Printf("Expected no error, but got %q", err)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/rice/clean.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "go/build"
6 | "os"
7 | "path/filepath"
8 | "strings"
9 | )
10 |
11 | func operationClean(pkg *build.Package) {
12 | for _, filename := range pkg.GoFiles {
13 | verbosef("checking file '%s'\n", filename)
14 | if strings.HasSuffix(filename, ".rice-box.go") || strings.HasSuffix(filename, ".rice-single.go") {
15 | err := os.Remove(filepath.Join(pkg.Dir, filename))
16 | if err != nil {
17 | fmt.Printf("error removing file (%s): %s\n", filename, err)
18 | os.Exit(-1)
19 | }
20 | verbosef("removed file '%s'\n", filename)
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/modulus.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "fmt"
5 | "github.com/drone/drone/pkg/build/buildfile"
6 | )
7 |
8 | type Modulus struct {
9 | Project string `yaml:"project,omitempty"`
10 | Token string `yaml:"token,omitempty"`
11 | }
12 |
13 | func (m *Modulus) Write(f *buildfile.Buildfile) {
14 | f.WriteEnv("MODULUS_TOKEN", m.Token)
15 |
16 | // Install the Modulus command line interface then deploy the configured
17 | // project.
18 | f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g modulus")
19 | f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g modulus")
20 | f.WriteCmd(fmt.Sprintf("modulus deploy -p '%s'", m.Project))
21 | }
22 |
--------------------------------------------------------------------------------
/pkg/template/pages/register.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Register · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Registration
5 | {{ if .Error }}
6 | {{.Error}}
7 | {{ end }}
8 |
9 |
10 |
11 |
12 |
18 | {{ end }}
19 |
20 | {{ define "script" }}
21 | {{ end }}
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/hooks/merge_request.json:
--------------------------------------------------------------------------------
1 | {
2 | "object_kind": "merge_request",
3 | "object_attributes": {
4 | "id": 99,
5 | "target_branch": "master",
6 | "source_branch": "ms-viewport",
7 | "source_project_id": 14,
8 | "author_id": 51,
9 | "assignee_id": 6,
10 | "title": "MS-Viewport",
11 | "created_at": "2013-12-03T17:23:34Z",
12 | "updated_at": "2013-12-03T17:23:34Z",
13 | "st_commits": null,
14 | "st_diffs": null,
15 | "milestone_id": null,
16 | "state": "opened",
17 | "merge_status": "unchecked",
18 | "target_project_id": 14,
19 | "iid": 1,
20 | "description": ""
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/nodejitsu.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/buildfile"
5 | )
6 |
7 | type Nodejitsu struct {
8 | App string `yaml:"app,omitempty"`
9 | User string `yaml:"user,omitempty"`
10 | Token string `yaml:"token,omitempty"`
11 | }
12 |
13 | func (n *Nodejitsu) Write(f *buildfile.Buildfile) {
14 | f.WriteEnv("username", n.User)
15 | f.WriteEnv("apiToken", n.Token)
16 |
17 | // Install the jitsu command line interface then
18 | // deploy the configured app.
19 | f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g jitsu")
20 | f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g jitsu")
21 | f.WriteCmd("jitsu deploy")
22 | }
23 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/public_keys/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "title": "Public key",
5 | "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
6 | },
7 | {
8 | "id": 3,
9 | "title": "Another Public key",
10 | "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
11 | }
12 | ]
--------------------------------------------------------------------------------
/pkg/build/writer_test.go:
--------------------------------------------------------------------------------
1 | package build
2 |
3 | import (
4 | "bytes"
5 | "testing"
6 | )
7 |
8 | func TestSetupDockerfile(t *testing.T) {
9 | var buf bytes.Buffer
10 |
11 | // wrap the buffer so we can analyze output
12 | w := writer{&buf}
13 |
14 | w.WriteString("#DRONE:676f206275696c64\n")
15 | w.WriteString("#DRONE:676f2074657374202d76\n")
16 | w.WriteString("PASS\n")
17 | w.WriteString("ok github.com/garyburd/redigo/redis 0.113s\n")
18 |
19 | expected := `$ go build
20 | $ go test -v
21 | PASS
22 | ok github.com/garyburd/redigo/redis 0.113s
23 | `
24 | if expected != buf.String() {
25 | t.Errorf("Expected commands decoded and echoed correctly. got \n%s", buf.String())
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/pkg/channel/conn.go:
--------------------------------------------------------------------------------
1 | package channel
2 |
3 | import (
4 | "code.google.com/p/go.net/websocket"
5 | )
6 |
7 | type connection struct {
8 | // The websocket connection.
9 | ws *websocket.Conn
10 |
11 | // Buffered channel of outbound messages.
12 | send chan string
13 | }
14 |
15 | func (c *connection) reader() {
16 | for {
17 | var message string
18 | err := websocket.Message.Receive(c.ws, &message)
19 | if err != nil {
20 | break
21 | }
22 | }
23 |
24 | c.ws.Close()
25 | }
26 |
27 | func (c *connection) writer() {
28 | for message := range c.send {
29 | err := websocket.Message.Send(c.ws, message)
30 | if err != nil {
31 | break
32 | }
33 | }
34 |
35 | c.ws.Close()
36 | }
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/teams_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Teams(t *testing.T) {
8 |
9 | teams, err := client.Teams.List()
10 | if err != nil {
11 | t.Error(err)
12 | return
13 | }
14 |
15 | if len(teams) == 0 {
16 | t.Errorf("Returned an empty list of teams. Expected at least one result")
17 | return
18 | }
19 |
20 | if len(teams) == 1 {
21 | if teams[0].Name != testUser {
22 | t.Errorf("expected team name [%s], got [%s]", testUser, teams[0].Name)
23 | }
24 | if teams[0].Role != TeamRoleAdmin {
25 | t.Errorf("expected team role [%s], got [%s]", TeamRoleAdmin, teams[0].Role)
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/bitbucket.org/kardianos/osext/osext_procfs.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux netbsd openbsd
6 |
7 | package osext
8 |
9 | import (
10 | "errors"
11 | "os"
12 | "runtime"
13 | )
14 |
15 | func executable() (string, error) {
16 | switch runtime.GOOS {
17 | case "linux":
18 | return os.Readlink("/proc/self/exe")
19 | case "netbsd":
20 | return os.Readlink("/proc/curproc/exe")
21 | case "openbsd":
22 | return os.Readlink("/proc/curproc/file")
23 | }
24 | return "", errors.New("ExecPath not implemented for " + runtime.GOOS)
25 | }
26 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/bmizerany/pat/example/hello.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "io"
5 | "net/http"
6 | "github.com/bmizerany/pat"
7 | "log"
8 | )
9 |
10 | // hello world, the web server
11 | func HelloServer(w http.ResponseWriter, req *http.Request) {
12 | io.WriteString(w, "hello, "+req.URL.Query().Get(":name")+"!\n")
13 | }
14 |
15 | func main() {
16 | m := pat.New()
17 | m.Get("/hello/:name", http.HandlerFunc(HelloServer))
18 |
19 | // Register this pat with the default serve mux so that other packages
20 | // may also be exported. (i.e. /debug/pprof/*)
21 | http.Handle("/", m)
22 | err := http.ListenAndServe(":12345", nil)
23 | if err != nil {
24 | log.Fatal("ListenAndServe: ", err)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/database/migrate/20140310104446_add_open_invitation_column.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | type rev20140310104446 struct{}
4 |
5 | var AddOpenInvitationColumn = &rev20140310104446{}
6 |
7 | func (r *rev20140310104446) Revision() int64 {
8 | return 20140310104446
9 | }
10 |
11 | func (r *rev20140310104446) Up(mg *MigrationDriver) error {
12 | // Suppress error here for backward compatibility
13 | _, err := mg.AddColumn("settings", "open_invitations BOOLEAN")
14 | _, err = mg.Tx.Exec("UPDATE settings SET open_invitations=0 WHERE open_invitations IS NULL")
15 | return err
16 | }
17 |
18 | func (r *rev20140310104446) Down(mg *MigrationDriver) error {
19 | _, err := mg.DropColumns("settings", "open_invitations")
20 | return err
21 | }
22 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:13.10
2 |
3 | MAINTAINER Drone.io Team
4 |
5 | RUN apt-get update
6 | RUN apt-get install -y wget gcc make g++ build-essential ca-certificates mercurial git bzr libsqlite3-dev sqlite3
7 |
8 | RUN wget https://go.googlecode.com/files/go1.2.src.tar.gz && tar zxvf go1.2.src.tar.gz && cd go/src && ./make.bash
9 |
10 | ENV PATH $PATH:/go/bin:/gocode/bin
11 | ENV GOPATH /gocode
12 |
13 | RUN mkdir -p /gocode/src/github.com/drone
14 |
15 | ADD . /gocode/src/github.com/drone/drone
16 |
17 | WORKDIR /gocode/src/github.com/drone/drone
18 |
19 | RUN make deps
20 | RUN make
21 | RUN make install
22 |
23 | EXPOSE 80
24 |
25 | ENTRYPOINT ["/usr/local/bin/droned"]
26 |
27 | CMD ["--port=:80", "--path=/var/lib/drone/drone.sqlite"]
28 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/go-sql-driver/mysql/result.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
4 | //
5 | // This Source Code Form is subject to the terms of the Mozilla Public
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7 | // You can obtain one at http://mozilla.org/MPL/2.0/.
8 |
9 | package mysql
10 |
11 | type mysqlResult struct {
12 | affectedRows int64
13 | insertId int64
14 | }
15 |
16 | func (res *mysqlResult) LastInsertId() (int64, error) {
17 | return res.insertId, nil
18 | }
19 |
20 | func (res *mysqlResult) RowsAffected() (int64, error) {
21 | return res.affectedRows, nil
22 | }
23 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/commits/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "ed899a2f4b50b4370feeea94676502b42383c746",
4 | "short_id": "ed899a2f4b5",
5 | "title": "Replace sanitize with escape once",
6 | "author_name": "Dmitriy Zaporozhets",
7 | "author_email": "dzaporozhets@sphereconsultinginc.com",
8 | "created_at": "2012-09-20T11:50:22+03:00"
9 | },
10 | {
11 | "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
12 | "short_id": "6104942438c",
13 | "title": "Sanitize for network graph",
14 | "author_name": "randx",
15 | "author_email": "dmitriy.zaporozhets@gmail.com",
16 | "created_at": "2012-09-20T09:06:12+03:00"
17 | }
18 | ]
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/gotest.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | type gotestReporter struct{ test T }
4 |
5 | func (self *gotestReporter) BeginStory(story *StoryReport) {
6 | self.test = story.Test
7 | }
8 |
9 | func (self *gotestReporter) Enter(scope *ScopeReport) {}
10 |
11 | func (self *gotestReporter) Report(r *AssertionResult) {
12 | if !passed(r) {
13 | self.test.Fail()
14 | }
15 | }
16 |
17 | func (self *gotestReporter) Exit() {}
18 |
19 | func (self *gotestReporter) EndStory() {
20 | self.test = nil
21 | }
22 |
23 | func NewGoTestReporter() *gotestReporter {
24 | return new(gotestReporter)
25 | }
26 |
27 | func passed(r *AssertionResult) bool {
28 | return r.Error == nil && r.Failure == ""
29 | }
30 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/dockerversion/dockerversion.go:
--------------------------------------------------------------------------------
1 | package dockerversion
2 |
3 | // FIXME: this should be embedded in the docker/docker.go,
4 | // but we can't because distro policy requires us to
5 | // package a separate dockerinit binary, and that binary needs
6 | // to know its version too.
7 |
8 | var (
9 | GITCOMMIT string
10 | VERSION string
11 |
12 | IAMSTATIC bool // whether or not Docker itself was compiled statically via ./hack/make.sh binary
13 | INITSHA1 string // sha1sum of separate static dockerinit, if Docker itself was compiled dynamically via ./hack/make.sh dynbinary
14 | INITPATH string // custom location to search for a valid dockerinit binary (available for packagers as a last resort escape hatch)
15 | )
16 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.net/websocket/examplehandler_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket_test
6 |
7 | import (
8 | "io"
9 | "net/http"
10 |
11 | "code.google.com/p/go.net/websocket"
12 | )
13 |
14 | // Echo the data received on the WebSocket.
15 | func EchoServer(ws *websocket.Conn) {
16 | io.Copy(ws, ws)
17 | }
18 |
19 | // This example demonstrates a trivial echo server.
20 | func ExampleHandler() {
21 | http.Handle("/echo", websocket.Handler(EchoServer))
22 | err := http.ListenAndServe(":12345", nil)
23 | if err != nil {
24 | panic("ListenAndServe: " + err.Error())
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/pkg/database/migrate/201402211147_github_enterprise_support.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | type Rev3 struct{}
4 |
5 | var GitHubEnterpriseSupport = &Rev3{}
6 |
7 | func (r *Rev3) Revision() int64 {
8 | return 201402211147
9 | }
10 |
11 | func (r *Rev3) Up(mg *MigrationDriver) error {
12 | _, err := mg.AddColumn("settings", "github_domain VARCHAR(255)")
13 | if err != nil {
14 | return err
15 | }
16 | _, err = mg.AddColumn("settings", "github_apiurl VARCHAR(255)")
17 |
18 | mg.Tx.Exec("update settings set github_domain=?", "github.com")
19 | mg.Tx.Exec("update settings set github_apiurl=?", "https://api.github.com")
20 | return err
21 | }
22 |
23 | func (r *Rev3) Down(mg *MigrationDriver) error {
24 | _, err := mg.DropColumns("settings", "github_domain", "github_apiurl")
25 | return err
26 | }
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/message.go:
--------------------------------------------------------------------------------
1 | package hipchat
2 |
3 | import (
4 | "time"
5 | )
6 |
7 | const (
8 | ISO8601 = "2006-01-02T15:04:05-0700"
9 | )
10 |
11 | type Message struct {
12 | // Date message was sent in ISO-8601 format in request timezone.
13 | ISODate string `json:"date"`
14 |
15 | // Name and user_id of sender. user_id will be "api" for API messages and "guest" for guest messages.
16 | From struct {
17 | Name string
18 | UserId interface{} `json:"user_id"`
19 | }
20 |
21 | // Message body.
22 | Message string
23 |
24 | // Name, size, and URL of uploaded file.
25 | File struct {
26 | Name string
27 | Size int
28 | URL string
29 | }
30 | }
31 |
32 | func (m *Message) Time() (time.Time, error) {
33 | return time.Parse(ISO8601, m.ISODate)
34 | }
35 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/emails_test.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Emails(t *testing.T) {
8 |
9 | const dummyEmail = "dummy@localhost.com"
10 |
11 | // CREATE an email entry
12 | if err := client.Emails.Create(dummyEmail); err != nil {
13 | t.Error(err)
14 | return
15 | }
16 |
17 | // DELETE the email
18 | defer client.Emails.Delete(dummyEmail)
19 |
20 | // FIND the email
21 | if _, err := client.Emails.Find(dummyEmail); err != nil {
22 | t.Error(err)
23 | return
24 | }
25 |
26 | // LIST the email addresses
27 | emails, err := client.Emails.List()
28 | if err != nil {
29 | t.Error(err)
30 | return
31 | }
32 |
33 | if len(emails) == 0 {
34 | t.Errorf("List of emails returned empty set")
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/tags/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "v1.0.0",
4 | "commit": {
5 | "id": "2695effb5807a22ff3d138d593fd856244e155e7",
6 | "parents": [],
7 | "tree": "38017f2f189336fe4497e9d230c5bb1bf873f08d",
8 | "message": "Initial commit",
9 | "author": {
10 | "name": "John Smith",
11 | "email": "john@example.com"
12 | },
13 | "committer": {
14 | "name": "Jack Smith",
15 | "email": "jack@example.com"
16 | },
17 | "authored_date": "2012-05-28T04:42:42-07:00",
18 | "committed_date": "2012-05-28T04:42:42-07:00"
19 | },
20 | "protected": null
21 | }
22 | ]
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/Makefile:
--------------------------------------------------------------------------------
1 | include $(GOROOT)/src/Make.inc
2 |
3 | YAML=yaml-0.1.3
4 | LIBYAML=$(PWD)/$(YAML)/src/.libs/libyaml.a
5 |
6 | TARG=launchpad.net/goyaml
7 |
8 | GOFILES=\
9 | goyaml.go\
10 | resolve.go\
11 |
12 | CGOFILES=\
13 | decode.go\
14 | encode.go\
15 |
16 | CGO_OFILES+=\
17 | helpers.o\
18 | api.o\
19 | scanner.o\
20 | reader.o\
21 | parser.o\
22 | writer.o\
23 | emitter.o\
24 |
25 | GOFMT=gofmt
26 |
27 | BADFMT:=$(shell $(GOFMT) -l $(GOFILES) $(CGOFILES) $(wildcard *_test.go))
28 |
29 | all: package
30 | gofmt: $(BADFMT)
31 | @for F in $(BADFMT); do $(GOFMT) -w $$F && echo $$F; done
32 |
33 | include $(GOROOT)/src/Make.pkg
34 |
35 | ifneq ($(BADFMT),)
36 | ifneq ($(MAKECMDGOALS),gofmt)
37 | $(warning WARNING: make gofmt: $(BADFMT))
38 | endif
39 | endif
40 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/int.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Int struct {
8 | increment int
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Int
13 | func (i *Int) Next() int {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (int) that was returned by the most recent call to this instance's Next()
21 | func (i *Int) Last() int {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Int) Set(value int) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/emails_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Emails(t *testing.T) {
8 |
9 | const dummyEmail = "dummy@localhost.com"
10 |
11 | // CREATE an email entry
12 | if _, err := client.Emails.Find(testUser, dummyEmail); err != nil {
13 | _, cerr := client.Emails.Create(testUser, dummyEmail)
14 | if cerr != nil {
15 | t.Error(cerr)
16 | return
17 | }
18 | }
19 |
20 | // FIND the email
21 | _, err := client.Emails.Find(testUser, dummyEmail)
22 | if err != nil {
23 | t.Error(err)
24 | }
25 |
26 | // LIST the email addresses
27 | emails, err := client.Emails.List(testUser)
28 | if err != nil {
29 | t.Error(err)
30 | }
31 |
32 | if len(emails) == 0 {
33 | t.Errorf("List of emails returned empty set")
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/branches/show.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "master",
3 | "commit": {
4 | "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
5 | "parents": [
6 | {
7 | "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
8 | }
9 | ],
10 | "tree": "46e82de44b1061621357f24c05515327f2795a95",
11 | "message": "add projects API",
12 | "author": {
13 | "name": "John Smith",
14 | "email": "john@example.com"
15 | },
16 | "committer": {
17 | "name": "John Smith",
18 | "email": "john@example.com"
19 | },
20 | "authored_date": "2012-06-27T05:51:39-07:00",
21 | "committed_date": "2012-06-28T03:44:20-07:00"
22 | },
23 | "protected": true
24 | }
--------------------------------------------------------------------------------
/pkg/template/pages/login.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Login · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Login
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
19 | {{ end }}
20 |
21 | {{ define "script" }}
22 |
27 | {{ end }}
28 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/int8.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Int8 struct {
8 | increment int8
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Int8
13 | func (i *Int8) Next() int8 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (int8) that was returned by the most recent call to this instance's Next()
21 | func (i *Int8) Last() int8 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Int8) Set(value int8) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/uint.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Uint struct {
8 | increment uint
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Uint
13 | func (i *Uint) Next() uint {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (uint) that was returned by the most recent call to this instance's Next()
21 | func (i *Uint) Last() uint {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Uint) Set(value uint) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/setns_linux.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "fmt"
5 | "runtime"
6 | "syscall"
7 | )
8 |
9 | // Via http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7b21fddd087678a70ad64afc0f632e0f1071b092
10 | //
11 | // We need different setns values for the different platforms and arch
12 | // We are declaring the macro here because the SETNS syscall does not exist in th stdlib
13 | var setNsMap = map[string]uintptr{
14 | "linux/amd64": 308,
15 | }
16 |
17 | func Setns(fd uintptr, flags uintptr) error {
18 | ns, exists := setNsMap[fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)]
19 | if !exists {
20 | return ErrNotSupportedPlatform
21 | }
22 | _, _, err := syscall.RawSyscall(ns, fd, flags, 0)
23 | if err != 0 {
24 | return err
25 | }
26 | return nil
27 | }
28 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/int16.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Int16 struct {
8 | increment int16
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Int16
13 | func (i *Int16) Next() int16 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (int16) that was returned by the most recent call to this instance's Next()
21 | func (i *Int16) Last() int16 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Int16) Set(value int16) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/int32.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Int32 struct {
8 | increment int32
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Int32
13 | func (i *Int32) Next() int32 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (int32) that was returned by the most recent call to this instance's Next()
21 | func (i *Int32) Last() int32 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Int32) Set(value int32) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/int64.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Int64 struct {
8 | increment int64
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Int64
13 | func (i *Int64) Next() int64 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (int64) that was returned by the most recent call to this instance's Next()
21 | func (i *Int64) Last() int64 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Int64) Set(value int64) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/uint8.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Uint8 struct {
8 | increment uint8
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Uint8
13 | func (i *Uint8) Next() uint8 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (uint8) that was returned by the most recent call to this instance's Next()
21 | func (i *Uint8) Last() uint8 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Uint8) Set(value uint8) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/serializer.go:
--------------------------------------------------------------------------------
1 | package assertions
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 |
7 | "github.com/smartystreets/goconvey/convey/reporting"
8 | )
9 |
10 | type Serializer interface {
11 | serialize(expected, actual interface{}, message string) string
12 | }
13 |
14 | type failureSerializer struct{}
15 |
16 | func (self *failureSerializer) serialize(expected, actual interface{}, message string) string {
17 | view := reporting.FailureView{
18 | Message: message,
19 | Expected: fmt.Sprintf("%+v", expected),
20 | Actual: fmt.Sprintf("%+v", actual),
21 | }
22 | serialized, err := json.Marshal(view)
23 | if err != nil {
24 | return message
25 | }
26 | return string(serialized)
27 | }
28 |
29 | func newSerializer() *failureSerializer {
30 | return &failureSerializer{}
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/uint16.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Uint16 struct {
8 | increment uint16
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Uint16
13 | func (i *Uint16) Next() uint16 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (uint16) that was returned by the most recent call to this instance's Next()
21 | func (i *Uint16) Last() uint16 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Uint16) Set(value uint16) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/uint32.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Uint32 struct {
8 | increment uint32
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Uint32
13 | func (i *Uint32) Next() uint32 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (uint32) that was returned by the most recent call to this instance's Next()
21 | func (i *Uint32) Last() uint32 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Uint32) Set(value uint32) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/uint64.go:
--------------------------------------------------------------------------------
1 | package incremental
2 |
3 | import (
4 | "sync"
5 | )
6 |
7 | type Uint64 struct {
8 | increment uint64
9 | lock sync.Mutex
10 | }
11 |
12 | // Next returns with an integer that is exactly one higher as the previous call to Next() for this Uint64
13 | func (i *Uint64) Next() uint64 {
14 | i.lock.Lock()
15 | defer i.lock.Unlock()
16 | i.increment++
17 | return i.increment
18 | }
19 |
20 | // Last returns the number (uint64) that was returned by the most recent call to this instance's Next()
21 | func (i *Uint64) Last() uint64 {
22 | return i.increment
23 | }
24 |
25 | // Set changes the increment to given value, the succeeding call to Next() will return the given value+1
26 | func (i *Uint64) Set(value uint64) {
27 | i.lock.Lock()
28 | defer i.lock.Unlock()
29 | i.increment = value
30 | }
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.text/unicode/norm/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright 2011 The Go Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style
3 | # license that can be found in the LICENSE file.
4 |
5 | maketables: maketables.go triegen.go
6 | go build $^
7 |
8 | maketesttables: maketesttables.go triegen.go
9 | go build $^
10 |
11 | normregtest: normregtest.go
12 | go build $^
13 |
14 | tables: maketables
15 | ./maketables > tables.go
16 | gofmt -w tables.go
17 |
18 | trietesttables: maketesttables
19 | ./maketesttables > triedata_test.go
20 | gofmt -w triedata_test.go
21 |
22 | # Downloads from www.unicode.org, so not part
23 | # of standard test scripts.
24 | test: testtables regtest
25 |
26 | testtables: maketables
27 | ./maketables -test > data_test.go && go test -tags=test
28 |
29 | regtest: normregtest
30 | ./normregtest
31 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/room.go:
--------------------------------------------------------------------------------
1 | package hipchat
2 |
3 | type Room struct {
4 | // The ID of the room.
5 | Id int `json:"room_id"`
6 |
7 | // The name of the room.
8 | Name string
9 |
10 | // The current room topic.
11 | Topic string
12 |
13 | // Time of last activity (sent message) in the room in UNIX time (UTC).
14 | // May be 0 in rare cases when the time is unknown.
15 | LastActive int `json:"last_active"`
16 |
17 | // Time the room was created in UNIX time (UTC).
18 | Created int
19 |
20 | // Whether or not this room is archived.
21 | Archived bool `json:"is_archived"`
22 |
23 | // Whether or not this room is private.
24 | Private bool `json:"is_private"`
25 |
26 | // User ID of the room owner.
27 | OwnerUserId int `json:"owner_user_id"`
28 |
29 | // XMPP/Jabber ID of the room.
30 | XMPPJabberId string `json:"xmpp_jid"`
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions/serializer_test.go:
--------------------------------------------------------------------------------
1 | package assertions
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "testing"
7 |
8 | "github.com/smartystreets/goconvey/convey/reporting"
9 | )
10 |
11 | func TestSerializerCreatesSerializedVersionOfAssertionResult(t *testing.T) {
12 | thing1 := Thing1{"Hi"}
13 | thing2 := Thing2{"Bye"}
14 | message := "Super-hip failure message."
15 | serializer := newSerializer()
16 |
17 | actualResult := serializer.serialize(thing1, thing2, message)
18 |
19 | expectedResult, _ := json.Marshal(reporting.FailureView{
20 | Message: message,
21 | Expected: fmt.Sprintf("%+v", thing1),
22 | Actual: fmt.Sprintf("%+v", thing2),
23 | })
24 |
25 | if actualResult != string(expectedResult) {
26 | t.Errorf("\nExpected: %s\nActual: %s", string(expectedResult), actualResult)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.net/websocket/exampledial_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket_test
6 |
7 | import (
8 | "fmt"
9 | "log"
10 |
11 | "code.google.com/p/go.net/websocket"
12 | )
13 |
14 | // This example demonstrates a trivial client.
15 | func ExampleDial() {
16 | origin := "http://localhost/"
17 | url := "ws://localhost:12345/ws"
18 | ws, err := websocket.Dial(url, "", origin)
19 | if err != nil {
20 | log.Fatal(err)
21 | }
22 | if _, err := ws.Write([]byte("hello, world!\n")); err != nil {
23 | log.Fatal(err)
24 | }
25 | var msg = make([]byte, 512)
26 | var n int
27 | if n, err = ws.Read(msg); err != nil {
28 | log.Fatal(err)
29 | }
30 | fmt.Printf("Received: %s.\n", msg[:n])
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/utimes_linux.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "syscall"
5 | "unsafe"
6 | )
7 |
8 | func LUtimesNano(path string, ts []syscall.Timespec) error {
9 | // These are not currently available in syscall
10 | AT_FDCWD := -100
11 | AT_SYMLINK_NOFOLLOW := 0x100
12 |
13 | var _path *byte
14 | _path, err := syscall.BytePtrFromString(path)
15 | if err != nil {
16 | return err
17 | }
18 |
19 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(AT_FDCWD), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(AT_SYMLINK_NOFOLLOW), 0, 0); err != 0 && err != syscall.ENOSYS {
20 | return err
21 | }
22 |
23 | return nil
24 | }
25 |
26 | func UtimesNano(path string, ts []syscall.Timespec) error {
27 | if err := syscall.UtimesNano(path, ts); err != nil {
28 | return err
29 | }
30 | return nil
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/repos_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Repos(t *testing.T) {
8 |
9 | // LIST of repositories
10 | repos, err := client.Repos.List()
11 | if err != nil {
12 | t.Error(err)
13 | }
14 |
15 | if len(repos) == 0 {
16 | t.Errorf("List of /user repositories returned empty set")
17 | }
18 |
19 | // LIST dashboard repositories
20 | accts, err := client.Repos.ListDashboard()
21 | if err != nil {
22 | t.Error(err)
23 | }
24 |
25 | if len(accts) == 0 {
26 | t.Errorf("List of dashboard repositories returned empty set")
27 | }
28 |
29 | // FIND the named repo
30 | repo, err := client.Repos.Find(testUser, testRepo)
31 | if err != nil {
32 | t.Error(err)
33 | }
34 |
35 | if repo.Slug != testRepo {
36 | t.Errorf("repo slug [%v]; want [%v]", repo.Slug, testRepo)
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/pkg/build/proxy/proxy_test.go:
--------------------------------------------------------------------------------
1 | package proxy
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestProxy(t *testing.T) {
8 | // test creating a proxy with a few different
9 | // addresses, and our ability to create the
10 | // proxy shell script.
11 | p := Proxy{}
12 | p.Set("8080", "172.1.4.5")
13 | p.Set("8000", "172.1.3.1")
14 | b := p.Bytes()
15 |
16 | expected := `#!/bin/bash
17 | [ -x /usr/bin/socat ] && socat TCP-LISTEN:8080,fork TCP:172.1.4.5:8080 &
18 | [ -x /usr/bin/socat ] && socat TCP-LISTEN:8000,fork TCP:172.1.3.1:8000 &
19 | `
20 | if string(b) != expected {
21 | t.Errorf("Invalid proxy \n%s", expected)
22 | }
23 |
24 | // test creating a proxy script when there
25 | // are no proxy addresses added to the map
26 | p = Proxy{}
27 | b = p.Bytes()
28 | expected = "#!/bin/bash\n"
29 | if string(b) != expected {
30 | t.Errorf("Invalid proxy \n%s", expected)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/uniuri/uniuri_test.go:
--------------------------------------------------------------------------------
1 | package uniuri
2 |
3 | import "testing"
4 |
5 | func TestNew(t *testing.T) {
6 | u := New()
7 | // Check length
8 | if len(u) != StdLen {
9 | t.Fatalf("wrong length: expected %d, got %d", StdLen, len(u))
10 | }
11 | // Check that only allowed characters are present
12 | for _, c := range u {
13 | var present bool
14 | for _, a := range StdChars {
15 | if rune(a) == c {
16 | present = true
17 | }
18 | }
19 | if !present {
20 | t.Fatalf("chars not allowed in %q", u)
21 | }
22 | }
23 | // Generate 1000 uniuris and check that they are unique
24 | uris := make([]string, 1000)
25 | for i, _ := range uris {
26 | uris[i] = New()
27 | }
28 | for i, u := range uris {
29 | for j, u2 := range uris {
30 | if i != j && u == u2 {
31 | t.Fatalf("not unique: %d:%q and %d:%q", i, j, u, u2)
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/pkg/build/git/git.go:
--------------------------------------------------------------------------------
1 | package git
2 |
3 | const (
4 | DefaultGitDepth = 50
5 | )
6 |
7 | // Git stores the configuration details for
8 | // executing Git commands.
9 | type Git struct {
10 | // Depth options instructs git to create a shallow
11 | // clone with a history truncated to the specified
12 | // number of revisions.
13 | Depth *int `yaml:"depth,omitempty"`
14 |
15 | // The name of a directory to clone into.
16 | // TODO this still needs to be implemented. this field is
17 | // critical for forked Go projects, that need to clone
18 | // to a specific repository.
19 | Path string `yaml:"path,omitempty"`
20 | }
21 |
22 | // GitDepth returns GitDefaultDepth
23 | // when Git.Depth is empty.
24 | // GitDepth returns Git.Depth
25 | // when it is not empty.
26 | func GitDepth(g *Git) int {
27 | if g == nil || g.Depth == nil {
28 | return DefaultGitDepth
29 | }
30 | return *g.Depth
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/daemon.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "fmt"
5 | "io/ioutil"
6 | "log"
7 | "os"
8 | "strconv"
9 | )
10 |
11 | func CreatePidFile(pidfile string) error {
12 | if pidString, err := ioutil.ReadFile(pidfile); err == nil {
13 | pid, err := strconv.Atoi(string(pidString))
14 | if err == nil {
15 | if _, err := os.Stat(fmt.Sprintf("/proc/%d/", pid)); err == nil {
16 | return fmt.Errorf("pid file found, ensure docker is not running or delete %s", pidfile)
17 | }
18 | }
19 | }
20 |
21 | file, err := os.Create(pidfile)
22 | if err != nil {
23 | return err
24 | }
25 |
26 | defer file.Close()
27 |
28 | _, err = fmt.Fprintf(file, "%d", os.Getpid())
29 | return err
30 | }
31 |
32 | func RemovePidFile(pidfile string) {
33 | if err := os.Remove(pidfile); err != nil {
34 | log.Printf("Error removing %s: %s", pidfile, err)
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/jsonmessage_test.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestError(t *testing.T) {
8 | je := JSONError{404, "Not found"}
9 | if je.Error() != "Not found" {
10 | t.Fatalf("Expected 'Not found' got '%s'", je.Error())
11 | }
12 | }
13 |
14 | func TestProgress(t *testing.T) {
15 | jp := JSONProgress{}
16 | if jp.String() != "" {
17 | t.Fatalf("Expected empty string, got '%s'", jp.String())
18 | }
19 |
20 | jp2 := JSONProgress{Current: 1}
21 | if jp2.String() != " 1 B" {
22 | t.Fatalf("Expected ' 1 B', got '%s'", jp2.String())
23 | }
24 |
25 | jp3 := JSONProgress{Current: 50, Total: 100}
26 | if jp3.String() != "[=========================> ] 50 B/100 B" {
27 | t.Fatalf("Expected '[=========================> ] 50 B/100 B', got '%s'", jp3.String())
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/go-sql-driver/mysql/transaction.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
4 | //
5 | // This Source Code Form is subject to the terms of the Mozilla Public
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7 | // You can obtain one at http://mozilla.org/MPL/2.0/.
8 |
9 | package mysql
10 |
11 | type mysqlTx struct {
12 | mc *mysqlConn
13 | }
14 |
15 | func (tx *mysqlTx) Commit() (err error) {
16 | if tx.mc == nil || tx.mc.netConn == nil {
17 | return errInvalidConn
18 | }
19 | err = tx.mc.exec("COMMIT")
20 | tx.mc = nil
21 | return
22 | }
23 |
24 | func (tx *mysqlTx) Rollback() (err error) {
25 | if tx.mc == nil || tx.mc.netConn == nil {
26 | return errInvalidConn
27 | }
28 | err = tx.mc.exec("ROLLBACK")
29 | tx.mc = nil
30 | return
31 | }
32 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/utils/signal_freebsd.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "os"
5 | "os/signal"
6 | "syscall"
7 | )
8 |
9 | func CatchAll(sigc chan os.Signal) {
10 | signal.Notify(sigc,
11 | syscall.SIGABRT,
12 | syscall.SIGALRM,
13 | syscall.SIGBUS,
14 | syscall.SIGCHLD,
15 | syscall.SIGCONT,
16 | syscall.SIGFPE,
17 | syscall.SIGHUP,
18 | syscall.SIGILL,
19 | syscall.SIGINT,
20 | syscall.SIGIO,
21 | syscall.SIGIOT,
22 | syscall.SIGKILL,
23 | syscall.SIGPIPE,
24 | syscall.SIGPROF,
25 | syscall.SIGQUIT,
26 | syscall.SIGSEGV,
27 | syscall.SIGSTOP,
28 | syscall.SIGSYS,
29 | syscall.SIGTERM,
30 | syscall.SIGTRAP,
31 | syscall.SIGTSTP,
32 | syscall.SIGTTIN,
33 | syscall.SIGTTOU,
34 | syscall.SIGURG,
35 | syscall.SIGUSR1,
36 | syscall.SIGUSR2,
37 | syscall.SIGVTALRM,
38 | syscall.SIGWINCH,
39 | syscall.SIGXCPU,
40 | syscall.SIGXFSZ,
41 | )
42 | }
43 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/dot.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import "fmt"
4 |
5 | type dot struct{ out *Printer }
6 |
7 | func (self *dot) BeginStory(story *StoryReport) {}
8 |
9 | func (self *dot) Enter(scope *ScopeReport) {}
10 |
11 | func (self *dot) Report(report *AssertionResult) {
12 | if report.Error != nil {
13 | fmt.Print(redColor)
14 | self.out.Insert(dotError)
15 | } else if report.Failure != "" {
16 | fmt.Print(yellowColor)
17 | self.out.Insert(dotFailure)
18 | } else if report.Skipped {
19 | fmt.Print(yellowColor)
20 | self.out.Insert(dotSkip)
21 | } else {
22 | fmt.Print(greenColor)
23 | self.out.Insert(dotSuccess)
24 | }
25 | fmt.Print(resetColor)
26 | }
27 |
28 | func (self *dot) Exit() {}
29 |
30 | func (self *dot) EndStory() {}
31 |
32 | func NewDotReporter(out *Printer) *dot {
33 | self := new(dot)
34 | self.out = out
35 | return self
36 | }
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | /*
6 | Package ssh implements an SSH client and server.
7 |
8 | SSH is a transport security protocol, an authentication protocol and a
9 | family of application protocols. The most typical application level
10 | protocol is a remote shell and this is specifically implemented. However,
11 | the multiplexed nature of SSH is exposed to users that wish to support
12 | others.
13 |
14 | References:
15 | [PROTOCOL.certkeys]: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys
16 | [PROTOCOL.agent]: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent
17 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1
18 | */
19 | package ssh
20 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/system/proc.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "io/ioutil"
5 | "path/filepath"
6 | "strconv"
7 | "strings"
8 | )
9 |
10 | // look in /proc to find the process start time so that we can verify
11 | // that this pid has started after ourself
12 | func GetProcessStartTime(pid int) (string, error) {
13 | data, err := ioutil.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "stat"))
14 | if err != nil {
15 | return "", err
16 | }
17 | parts := strings.Split(string(data), " ")
18 | // the starttime is located at pos 22
19 | // from the man page
20 | //
21 | // starttime %llu (was %lu before Linux 2.6)
22 | // (22) The time the process started after system boot. In kernels before Linux 2.6, this
23 | // value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks
24 | // (divide by sysconf(_SC_CLK_TCK)).
25 | return parts[22-1], nil // starts at 1
26 | }
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/branches/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "master",
4 | "commit": {
5 | "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
6 | "parents": [
7 | {
8 | "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
9 | }
10 | ],
11 | "tree": "46e82de44b1061621357f24c05515327f2795a95",
12 | "message": "add projects API",
13 | "author": {
14 | "name": "John Smith",
15 | "email": "john@example.com"
16 | },
17 | "committer": {
18 | "name": "John Smith",
19 | "email": "john@example.com"
20 | },
21 | "authored_date": "2012-06-27T05:51:39-07:00",
22 | "committed_date": "2012-06-28T03:44:20-07:00"
23 | },
24 | "protected": true
25 | }
26 | ]
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/stat_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux darwin dragonfly freebsd openbsd netbsd solaris
6 |
7 | package tar
8 |
9 | import (
10 | "os"
11 | "syscall"
12 | )
13 |
14 | func init() {
15 | sysStat = statUnix
16 | }
17 |
18 | func statUnix(fi os.FileInfo, h *Header) error {
19 | sys, ok := fi.Sys().(*syscall.Stat_t)
20 | if !ok {
21 | return nil
22 | }
23 | h.Uid = int(sys.Uid)
24 | h.Gid = int(sys.Gid)
25 | // TODO(bradfitz): populate username & group. os/user
26 | // doesn't cache LookupId lookups, and lacks group
27 | // lookup functions.
28 | h.AccessTime = statAtime(sys)
29 | h.ChangeTime = statCtime(sys)
30 | // TODO(bradfitz): major/minor device numbers?
31 | return nil
32 | }
33 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/client_test.go:
--------------------------------------------------------------------------------
1 | package ssh
2 |
3 | import (
4 | "net"
5 | "testing"
6 | )
7 |
8 | func testClientVersion(t *testing.T, config *ClientConfig, expected string) {
9 | clientConn, serverConn := net.Pipe()
10 | receivedVersion := make(chan string, 1)
11 | go func() {
12 | version, err := readVersion(serverConn)
13 | if err != nil {
14 | receivedVersion <- ""
15 | } else {
16 | receivedVersion <- string(version)
17 | }
18 | serverConn.Close()
19 | }()
20 | Client(clientConn, config)
21 | actual := <-receivedVersion
22 | if actual != expected {
23 | t.Fatalf("got %s; want %s", actual, expected)
24 | }
25 | }
26 |
27 | func TestCustomClientVersion(t *testing.T) {
28 | version := "Test-Client-Version-0.0"
29 | testClientVersion(t, &ClientConfig{ClientVersion: version}, version)
30 | }
31 |
32 | func TestDefaultClientVersion(t *testing.T) {
33 | testClientVersion(t, &ClientConfig{}, packageVersion)
34 | }
35 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/bitbucket.org/kardianos/osext/osext_windows.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package osext
6 |
7 | import (
8 | "syscall"
9 | "unicode/utf16"
10 | "unsafe"
11 | )
12 |
13 | var (
14 | kernel = syscall.MustLoadDLL("kernel32.dll")
15 | getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW")
16 | )
17 |
18 | // GetModuleFileName() with hModule = NULL
19 | func executable() (exePath string, err error) {
20 | return getModuleFileName()
21 | }
22 |
23 | func getModuleFileName() (string, error) {
24 | var n uint32
25 | b := make([]uint16, syscall.MAX_PATH)
26 | size := uint32(len(b))
27 |
28 | r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size))
29 | n = uint32(r0)
30 | if n == 0 {
31 | return "", e1
32 | }
33 | return string(utf16.Decode(b[0:n])), nil
34 | }
35 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/github.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | // New creates an instance of the Github Client
4 | func New(token string) *Client {
5 | c := &Client{}
6 | c.Token = token
7 |
8 | c.Keys = &KeyResource{c}
9 | c.Repos = &RepoResource{c}
10 | c.Users = &UserResource{c}
11 | c.Orgs = &OrgResource{c}
12 | c.Emails = &EmailResource{c}
13 | c.Hooks = &HookResource{c}
14 | c.Contents = &ContentResource{c}
15 | c.RepoKeys = &RepoKeyResource{c}
16 | c.ApiUrl = "https://api.github.com"
17 | return c
18 | }
19 |
20 | type Client struct {
21 | ApiUrl string
22 | Token string
23 |
24 | Repos *RepoResource
25 | Users *UserResource
26 | Orgs *OrgResource
27 | Emails *EmailResource
28 | Keys *KeyResource
29 | Hooks *HookResource
30 | Contents *ContentResource
31 | RepoKeys *RepoKeyResource
32 | }
33 |
34 | // Guest Client that can be used to access
35 | // public APIs that do not require authentication.
36 | var Guest = New("")
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/users_test.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Users(t *testing.T) {
8 |
9 | // Get the currently authenticated user
10 | curr, err := client.Users.Current()
11 | if err != nil {
12 | t.Error(err)
13 | return
14 | }
15 | if curr.Login != testUser {
16 | t.Errorf("current user login [%v]; want [%v]", curr.Login, testUser)
17 | }
18 |
19 | // Get the named user
20 | u, err := client.Users.Find(testUser)
21 | if err != nil {
22 | t.Error(err)
23 | return
24 | }
25 | if curr.Login != u.Login {
26 | t.Errorf("named user login [%v]; want [%v]", curr.Login, u.Login)
27 | }
28 |
29 | }
30 |
31 | func Test_UsersGuest(t *testing.T) {
32 |
33 | // Get the named user
34 | u, err := Guest.Users.Find(testUser)
35 | if err != nil {
36 | t.Error(err)
37 | return
38 | }
39 | if testUser != u.Login {
40 | t.Errorf("named user login [%v]; want [%v]", u.Login, testUser)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/bitbucket.org/kardianos/osext/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Daniel Theophanes
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 |
16 | 2. Altered source versions must be plainly marked as such, and must not be
17 | misrepresented as being the original software.
18 |
19 | 3. This notice may not be removed or altered from any source
20 | distribution.
21 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/bmizerany/pat/example/hello_appengine.go:
--------------------------------------------------------------------------------
1 | // hello.go ported for appengine
2 | //
3 | // this differs from the standard hello.go example in two ways: appengine
4 | // already provides an http server for you, obviating the need for the
5 | // ListenAndServe call (with associated logging), and the package must not be
6 | // called main (appengine reserves package 'main' for the underlying program).
7 |
8 | package patexample
9 |
10 | import (
11 | "io"
12 | "net/http"
13 | "github.com/bmizerany/pat"
14 | )
15 |
16 | // hello world, the web server
17 | func HelloServer(w http.ResponseWriter, req *http.Request) {
18 | io.WriteString(w, "hello, "+req.URL.Query().Get(":name")+"!\n")
19 | }
20 |
21 | func init() {
22 | m := pat.New()
23 | m.Get("/hello/:name", http.HandlerFunc(HelloServer))
24 |
25 | // Register this pat with the default serve mux so that other packages
26 | // may also be exported. (i.e. /debug/pprof/*)
27 | http.Handle("/", m)
28 | }
29 |
--------------------------------------------------------------------------------
/pkg/queue/queue.go:
--------------------------------------------------------------------------------
1 | package queue
2 |
3 | import (
4 | "github.com/drone/drone/pkg/build/script"
5 | . "github.com/drone/drone/pkg/model"
6 | )
7 |
8 | // A Queue dispatches tasks to workers.
9 | type Queue struct {
10 | tasks chan<- *BuildTask
11 | }
12 |
13 | // BuildTasks represents a build that is pending
14 | // execution.
15 | type BuildTask struct {
16 | Repo *Repo
17 | Commit *Commit
18 | Build *Build
19 |
20 | // Build instructions from the .drone.yml
21 | // file, unmarshalled.
22 | Script *script.Build
23 | }
24 |
25 | // Start N workers with the given build runner.
26 | func Start(workers int, runner BuildRunner) *Queue {
27 | tasks := make(chan *BuildTask)
28 |
29 | queue := &Queue{tasks: tasks}
30 |
31 | for i := 0; i < workers; i++ {
32 | worker := worker{
33 | runner: runner,
34 | }
35 |
36 | go worker.work(tasks)
37 | }
38 |
39 | return queue
40 | }
41 |
42 | // Add adds the task to the build queue.
43 | func (q *Queue) Add(task *BuildTask) {
44 | q.tasks <- task
45 | }
46 |
--------------------------------------------------------------------------------
/pkg/template/pages/install.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Installation · drone.io{{ end }}
2 |
3 | {{ define "content" }}
4 | Installation
5 |
17 | {{ end }}
18 |
19 | {{ define "script" }}
20 |
24 | {{ end }}
25 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/bcrypt/base64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package bcrypt
6 |
7 | import "encoding/base64"
8 |
9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
10 |
11 | var bcEncoding = base64.NewEncoding(alphabet)
12 |
13 | func base64Encode(src []byte) []byte {
14 | n := bcEncoding.EncodedLen(len(src))
15 | dst := make([]byte, n)
16 | bcEncoding.Encode(dst, src)
17 | for dst[n-1] == '=' {
18 | n--
19 | }
20 | return dst[:n]
21 | }
22 |
23 | func base64Decode(src []byte) ([]byte, error) {
24 | numOfEquals := 4 - (len(src) % 4)
25 | for i := 0; i < numOfEquals; i++ {
26 | src = append(src, '=')
27 | }
28 |
29 | dst := make([]byte, bcEncoding.DecodedLen(len(src)))
30 | n, err := bcEncoding.Decode(dst, src)
31 | if err != nil {
32 | return nil, err
33 | }
34 | return dst[:n], nil
35 | }
36 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.text/transform/examples_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package transform_test
6 |
7 | import (
8 | "fmt"
9 | "unicode"
10 |
11 | "code.google.com/p/go.text/transform"
12 | "code.google.com/p/go.text/unicode/norm"
13 | )
14 |
15 | func ExampleRemoveFunc() {
16 | input := []byte(`tschüß; до свидания`)
17 |
18 | b := make([]byte, len(input))
19 |
20 | t := transform.RemoveFunc(unicode.IsSpace)
21 | n, _, _ := t.Transform(b, input, true)
22 | fmt.Println(string(b[:n]))
23 |
24 | t = transform.RemoveFunc(func(r rune) bool {
25 | return !unicode.Is(unicode.Latin, r)
26 | })
27 | n, _, _ = t.Transform(b, input, true)
28 | fmt.Println(string(b[:n]))
29 |
30 | n, _, _ = t.Transform(b, norm.NFD.Bytes(input), true)
31 | fmt.Println(string(b[:n]))
32 |
33 | // Output:
34 | // tschüß;досвидания
35 | // tschüß
36 | // tschuß
37 | }
38 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/users_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Users(t *testing.T) {
8 |
9 | // FIND the currently authenticated user
10 | curr, err := client.Users.Current()
11 | if err != nil {
12 | t.Error(err)
13 | }
14 |
15 | // Find the user by Id
16 | user, err := client.Users.Find(curr.User.Username)
17 | if err != nil {
18 | t.Error(err)
19 | }
20 |
21 | // verify we get back the correct data
22 | if user.User.Username != curr.User.Username {
23 | t.Errorf("username [%v]; want [%v]", user.User.Username, curr.User.Username)
24 | }
25 |
26 | }
27 |
28 | func Test_UsersGuest(t *testing.T) {
29 |
30 | // FIND the currently authenticated user
31 | user, err := Guest.Users.Find(testUser)
32 | if err != nil {
33 | t.Error(err)
34 | }
35 |
36 | // verify we get back the correct data
37 | if user.User.Username != testUser {
38 | t.Errorf("username [%v]; want [%v]", user.User.Username, testUser)
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/bitbucket.org/kardianos/osext/osext.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Extensions to the standard "os" package.
6 | package osext
7 |
8 | import "path/filepath"
9 |
10 | // Executable returns an absolute path that can be used to
11 | // re-invoke the current program.
12 | // It may not be valid after the current program exits.
13 | func Executable() (string, error) {
14 | p, err := executable()
15 | return filepath.Clean(p), err
16 | }
17 |
18 | // Returns same path as Executable, returns just the folder
19 | // path. Excludes the executable name.
20 | func ExecutableFolder() (string, error) {
21 | p, err := Executable()
22 | if err != nil {
23 | return "", err
24 | }
25 | folder, _ := filepath.Split(p)
26 | return folder, nil
27 | }
28 |
29 | // Depricated. Same as Executable().
30 | func GetExePath() (exePath string, err error) {
31 | return Executable()
32 | }
33 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/github_test.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | import (
4 | "errors"
5 | "os"
6 | )
7 |
8 | // Instance of the Github client that we'll use for our unit tests
9 | var client *Client
10 |
11 | var (
12 | // Dummy user that we'll use to run integration tests
13 | testUser string
14 |
15 | // Dummy repo that we'll use to run integration tests
16 | testRepo string
17 |
18 | // Valid OAuth token, issued for the `testUser` that we can
19 | // use for integration testing.
20 | testToken string
21 | )
22 |
23 | func init() {
24 |
25 | testUser = os.Getenv("GH_USER")
26 | testRepo = os.Getenv("GH_REPO")
27 | testToken = os.Getenv("GH_TOKEN")
28 |
29 | switch {
30 | case len(testUser) == 0:
31 | panic(errors.New("must set the GH_USER environment variable"))
32 | case len(testRepo) == 0:
33 | panic(errors.New("must set the GH_REPO environment variable"))
34 | case len(testToken) == 0:
35 | panic(errors.New("must set the GH_TOKEN environment variable"))
36 | }
37 |
38 | client = New(testToken)
39 | }
40 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/go-sql-driver/mysql/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Go-MySQL-Driver authors for copyright purposes.
2 |
3 | # If you are submitting a patch, please add your name or the name of the
4 | # organization which holds the copyright to this list in alphabetical order.
5 |
6 | # Names should be added to this file as
7 | # Name
8 | # The email address is not required for organizations.
9 | # Please keep the list sorted.
10 |
11 |
12 | # Individual Persons
13 |
14 | Arne Hormann
15 | Carlos Nieto
16 | Hanno Braun
17 | James Harr
18 | Julien Schmidt
19 | Leonardo YongUk Kim
20 | Lucas Liu
21 | Luke Scott
22 | Michael Woolnough
23 | Nicola Peduzzi
24 | Xiaobing Jiang
25 |
26 | # Organizations
27 |
28 | Google Inc.
29 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/options_test.go:
--------------------------------------------------------------------------------
1 | package flags
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestPassDoubleDash(t *testing.T) {
8 | var opts = struct {
9 | Value bool `short:"v"`
10 | }{}
11 |
12 | p := NewParser(&opts, PassDoubleDash)
13 | ret, err := p.ParseArgs([]string{"-v", "--", "-v", "-g"})
14 |
15 | if err != nil {
16 | t.Fatalf("Unexpected error: %v", err)
17 | return
18 | }
19 |
20 | if !opts.Value {
21 | t.Errorf("Expected Value to be true")
22 | }
23 |
24 | assertStringArray(t, ret, []string{"-v", "-g"})
25 | }
26 |
27 | func TestPassAfterNonOption(t *testing.T) {
28 | var opts = struct {
29 | Value bool `short:"v"`
30 | }{}
31 |
32 | p := NewParser(&opts, PassAfterNonOption)
33 | ret, err := p.ParseArgs([]string{"-v", "arg", "-v", "-g"})
34 |
35 | if err != nil {
36 | t.Fatalf("Unexpected error: %v", err)
37 | return
38 | }
39 |
40 | if !opts.Value {
41 | t.Errorf("Expected Value to be true")
42 | }
43 |
44 | assertStringArray(t, ret, []string{"arg", "-v", "-g"})
45 | }
46 |
--------------------------------------------------------------------------------
/pkg/handler/builds.go:
--------------------------------------------------------------------------------
1 | package handler
2 |
3 | import (
4 | "net/http"
5 |
6 | "github.com/drone/drone/pkg/database"
7 | . "github.com/drone/drone/pkg/model"
8 | )
9 |
10 | // Returns the combined stdout / stderr for an individual Build.
11 | func BuildOut(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error {
12 | branch := r.FormValue("branch")
13 | if branch == "" {
14 | branch = "master"
15 | }
16 |
17 | hash := r.FormValue(":commit")
18 | labl := r.FormValue(":label")
19 |
20 | // get the commit from the database
21 | commit, err := database.GetCommitBranchHash(branch, hash, repo.ID)
22 | if err != nil {
23 | return err
24 | }
25 |
26 | // get the build from the database
27 | build, err := database.GetBuildSlug(labl, commit.ID)
28 | if err != nil {
29 | return err
30 | }
31 |
32 | return RenderText(w, build.Stdout, http.StatusOK)
33 | }
34 |
35 | // Returns the gzipped stdout / stderr for an individual Build
36 | func BuildOutGzip(w http.ResponseWriter, r *http.Request, u *User) error {
37 | // TODO
38 | return nil
39 | }
40 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/example/example.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "github.com/GeertJohan/go.incremental"
6 | "runtime"
7 | )
8 |
9 | func main() {
10 | // use max cpu's
11 | runtime.GOMAXPROCS(runtime.NumCPU())
12 |
13 | // create new incremental.Int
14 | i := &incremental.Int{}
15 |
16 | // print some numbers
17 | fmt.Println(i.Next()) // print 1
18 | fmt.Println(i.Next()) // print 2
19 | fmt.Println(i.Next()) // print 3
20 |
21 | // create chan to check if goroutines are done
22 | done := make(chan int)
23 |
24 | // spawn 4 goroutines
25 | for a := 0; a < 4; a++ {
26 | // call goroutine with it's number (0-3)
27 | go func(aa int) {
28 | // print 10 incremental numbers
29 | for b := 0; b < 10; b++ {
30 | fmt.Printf("routine %d: %d\n", aa, i.Next())
31 | }
32 | // signal done
33 | done <- aa
34 | }(a)
35 | }
36 |
37 | // wait until all goroutines are done
38 | for a := 0; a < 4; a++ {
39 | fmt.Printf("goroutine %d done\n", <-done)
40 | }
41 | fmt.Println("all done")
42 | }
43 |
--------------------------------------------------------------------------------
/pkg/template/pages/github_link.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}GitHub · Add Repository{{ end }}
2 |
3 | {{ define "content" }}
4 |
5 |
6 |
7 | Repository Setup
8 | GitHub
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
Link Your GitHub Account
25 |
Link Now
26 |
27 |
28 |
29 |
30 | {{ end }}
31 |
32 | {{ define "script" }}{{ end }}
33 |
--------------------------------------------------------------------------------
/cmd/droned/assets/test/SpecRunner.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Jasmine Spec Runner v2.0.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go:
--------------------------------------------------------------------------------
1 | package sqlite3
2 |
3 | /*
4 | #include
5 | #include
6 | */
7 | import "C"
8 | import (
9 | "unsafe"
10 | )
11 |
12 | type Backup struct {
13 | b *C.sqlite3_backup
14 | }
15 |
16 | func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*Backup, error) {
17 | destptr := C.CString(dest)
18 | defer C.free(unsafe.Pointer(destptr))
19 | srcptr := C.CString(src)
20 | defer C.free(unsafe.Pointer(srcptr))
21 |
22 | if b := C.sqlite3_backup_init(c.db, destptr, conn.db, srcptr); b != nil {
23 | return &Backup{b: b}, nil
24 | }
25 | return nil, c.lastError()
26 | }
27 |
28 | func (b *Backup) Step(p int) error {
29 | return Error{Code: ErrNo(C.sqlite3_backup_step(b.b, C.int(p)))}
30 | }
31 |
32 | func (b *Backup) Remaining() int {
33 | return int(C.sqlite3_backup_remaining(b.b))
34 | }
35 |
36 | func (b *Backup) PageCount() int {
37 | return int(C.sqlite3_backup_pagecount(b.b))
38 | }
39 |
40 | func (b *Backup) Finish() error {
41 | return Error{Code: ErrNo(C.sqlite3_backup_finish(b.b))}
42 | }
43 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar/testdata/nil-uid.tar:
--------------------------------------------------------------------------------
1 | P1050238.JPG.log 0000664 00000000016 12130627766 012777 0 ustar eyefi eyefi 12130404200 12130627766 44,44,POWERON
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/closest.go:
--------------------------------------------------------------------------------
1 | package flags
2 |
3 | func levenshtein(s string, t string) int {
4 | if len(s) == 0 {
5 | return len(t)
6 | }
7 |
8 | if len(t) == 0 {
9 | return len(s)
10 | }
11 |
12 | var l1, l2, l3 int
13 |
14 | if len(s) == 1 {
15 | l1 = len(t) + 1
16 | } else {
17 | l1 = levenshtein(s[1:len(s)-1], t) + 1
18 | }
19 |
20 | if len(t) == 1 {
21 | l2 = len(s) + 1
22 | } else {
23 | l2 = levenshtein(t[1:len(t)-1], s) + 1
24 | }
25 |
26 | l3 = levenshtein(s[1:len(s)], t[1:len(t)])
27 |
28 | if s[0] != t[0] {
29 | l3++
30 | }
31 |
32 | if l2 < l1 {
33 | l1 = l2
34 | }
35 |
36 | if l1 < l3 {
37 | return l1
38 | }
39 |
40 | return l3
41 | }
42 |
43 | func closestChoice(cmd string, choices []string) (string, int) {
44 | if len(choices) == 0 {
45 | return "", 0
46 | }
47 |
48 | mincmd := -1
49 | mindist := -1
50 |
51 | for i, c := range choices {
52 | l := levenshtein(cmd, c)
53 |
54 | if mincmd < 0 || l < mindist {
55 | mindist = l
56 | mincmd = i
57 | }
58 | }
59 |
60 | return choices[mincmd], mindist
61 | }
62 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/projects_test.go:
--------------------------------------------------------------------------------
1 | package gogitlab
2 |
3 | import (
4 | "github.com/stretchr/testify/assert"
5 | "testing"
6 | )
7 |
8 | func TestProjects(t *testing.T) {
9 | ts, gitlab := Stub("stubs/projects/index.json")
10 | projects, err := gitlab.Projects()
11 |
12 | assert.Equal(t, err, nil)
13 | assert.Equal(t, len(projects), 2)
14 | defer ts.Close()
15 | }
16 |
17 | func TestProject(t *testing.T) {
18 | ts, gitlab := Stub("stubs/projects/show.json")
19 | project, err := gitlab.Project("1")
20 |
21 | assert.Equal(t, err, nil)
22 | assert.IsType(t, new(Project), project)
23 | assert.Equal(t, project.SshRepoUrl, "git@example.com:diaspora/diaspora-project-site.git")
24 | assert.Equal(t, project.HttpRepoUrl, "http://example.com/diaspora/diaspora-project-site.git")
25 | defer ts.Close()
26 | }
27 |
28 | func TestProjectBranches(t *testing.T) {
29 | ts, gitlab := Stub("stubs/projects/branches/index.json")
30 | branches, err := gitlab.ProjectBranches("1")
31 |
32 | assert.Equal(t, err, nil)
33 | assert.Equal(t, len(branches), 2)
34 | defer ts.Close()
35 | }
36 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/tag_test.go:
--------------------------------------------------------------------------------
1 | package flags
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestTagMissingColon(t *testing.T) {
8 | var opts = struct {
9 | Value bool `short`
10 | }{}
11 |
12 | assertParseFail(t, ErrTag, "expected `:' after key name, but got end of tag (in `short`)", &opts, "")
13 | }
14 |
15 | func TestTagMissingValue(t *testing.T) {
16 | var opts = struct {
17 | Value bool `short:`
18 | }{}
19 |
20 | assertParseFail(t, ErrTag, "expected `\"' to start tag value at end of tag (in `short:`)", &opts, "")
21 | }
22 |
23 | func TestTagMissingQuote(t *testing.T) {
24 | var opts = struct {
25 | Value bool `short:"v`
26 | }{}
27 |
28 | assertParseFail(t, ErrTag, "expected end of tag value `\"' at end of tag (in `short:\"v`)", &opts, "")
29 | }
30 |
31 | func TestTagNewline(t *testing.T) {
32 | var opts = struct {
33 | Value bool `long:"verbose" description:"verbose
34 | something"`
35 | }{}
36 |
37 | assertParseFail(t, ErrTag, "unexpected newline in tag value `description' (in `long:\"verbose\" description:\"verbose\nsomething\"`)", &opts, "")
38 | }
39 |
--------------------------------------------------------------------------------
/pkg/build/dockerfile/dockerfile.go:
--------------------------------------------------------------------------------
1 | package dockerfile
2 |
3 | import (
4 | "bytes"
5 | "fmt"
6 | )
7 |
8 | type Dockerfile struct {
9 | bytes.Buffer
10 | }
11 |
12 | func New(from string) *Dockerfile {
13 | d := Dockerfile{}
14 | d.WriteFrom(from)
15 | return &d
16 | }
17 |
18 | func (d *Dockerfile) WriteAdd(from, to string) {
19 | d.WriteString(fmt.Sprintf("ADD %s %s\n", from, to))
20 | }
21 |
22 | func (d *Dockerfile) WriteFrom(from string) {
23 | d.WriteString(fmt.Sprintf("FROM %s\n", from))
24 | }
25 |
26 | func (d *Dockerfile) WriteRun(cmd string) {
27 | d.WriteString(fmt.Sprintf("RUN %s\n", cmd))
28 | }
29 |
30 | func (d *Dockerfile) WriteUser(user string) {
31 | d.WriteString(fmt.Sprintf("USER %s\n", user))
32 | }
33 |
34 | func (d *Dockerfile) WriteEnv(key, val string) {
35 | d.WriteString(fmt.Sprintf("ENV %s %s\n", key, val))
36 | }
37 |
38 | func (d *Dockerfile) WriteWorkdir(workdir string) {
39 | d.WriteString(fmt.Sprintf("WORKDIR %s\n", workdir))
40 | }
41 |
42 | func (d *Dockerfile) WriteEntrypoint(entrypoint string) {
43 | d.WriteString(fmt.Sprintf("ENTRYPOINT %s\n", entrypoint))
44 | }
45 |
--------------------------------------------------------------------------------
/pkg/model/settings_test.go:
--------------------------------------------------------------------------------
1 | package model
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_SettingsValidate(t *testing.T) {
8 | settings := Settings{}
9 | settings.GitHubApiUrl = "https://github.com/url/with/slash/"
10 | if err := settings.Validate(); err != ErrInvalidGitHubTrailingSlash {
11 | t.Errorf("Expecting ErrInvalidGitHubTrailingSlash")
12 | }
13 |
14 | settings = Settings{}
15 | settings.SmtpServer = "127.1.1.1"
16 | if err := settings.Validate(); err != ErrInvalidSmtpPort {
17 | t.Errorf("Expecting ErrInvalidSmtpPort")
18 | }
19 |
20 | settings = Settings{}
21 | settings.SmtpServer = "127.1.1.1"
22 | settings.SmtpPort = "553"
23 | if err := settings.Validate(); err != ErrInvalidSmtpAddress {
24 | t.Errorf("Expecting ErrInvalidSmtpAddress")
25 | }
26 |
27 | settings = Settings{}
28 | settings.SmtpServer = "127.1.1.1"
29 | settings.SmtpPort = "553"
30 | settings.SmtpAddress = "test@localhost"
31 | settings.GitHubApiUrl = "https://api.github.com"
32 | if err := settings.Validate(); err != nil {
33 | t.Errorf("Expecting successful Settings validation, got %s", err)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/pkg/template/pages/bitbucket_link.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Bitbucket · Add Repository{{ end }}
2 |
3 | {{ define "content" }}
4 |
5 |
6 |
7 | Repository Setup
8 | Bitbucket
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
24 |
Link Your Bitbucket Account
25 |
Link Now
26 |
27 |
28 |
29 |
30 | {{ end }}
31 |
32 | {{ define "script" }}{{ end }}
33 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jacobsa/oglematchers/any.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Aaron Jacobs. All Rights Reserved.
2 | // Author: aaronjjacobs@gmail.com (Aaron Jacobs)
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | package oglematchers
17 |
18 | // Any returns a matcher that matches any value.
19 | func Any() Matcher {
20 | return &anyMatcher{}
21 | }
22 |
23 | type anyMatcher struct {
24 | }
25 |
26 | func (m *anyMatcher) Description() string {
27 | return "is anything"
28 | }
29 |
30 | func (m *anyMatcher) Matches(c interface{}) error {
31 | return nil
32 | }
33 |
--------------------------------------------------------------------------------
/pkg/build/proxy/proxy.go:
--------------------------------------------------------------------------------
1 | package proxy
2 |
3 | import (
4 | "bytes"
5 | "fmt"
6 | )
7 |
8 | // bash header
9 | const header = "#!/bin/bash\n"
10 |
11 | // this command string will check if the socat utility
12 | // exists, and if it does, will proxy connections to
13 | // the external IP address.
14 | const command = "[ -x /usr/bin/socat ] && socat TCP-LISTEN:%s,fork TCP:%s:%s &\n"
15 |
16 | // Proxy stores proxy configuration details mapping
17 | // a local port to an external IP address with the
18 | // same port number.
19 | type Proxy map[string]string
20 |
21 | func (p Proxy) Set(port, ip string) {
22 | p[port] = ip
23 | }
24 |
25 | // String converts the proxy configuration details
26 | // to a bash script.
27 | func (p Proxy) String() string {
28 | var buf bytes.Buffer
29 | buf.WriteString(header)
30 | for port, ip := range p {
31 | buf.WriteString(fmt.Sprintf(command, port, ip, port))
32 | }
33 |
34 | return buf.String()
35 | }
36 |
37 | // Bytes converts the proxy configuration details
38 | // to a bash script in byte array format.
39 | func (p Proxy) Bytes() []byte {
40 | return []byte(p.String())
41 | }
42 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/dot_test.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "errors"
5 | "testing"
6 | )
7 |
8 | func TestDotReporterAssertionPrinting(t *testing.T) {
9 | monochrome()
10 | file := newMemoryFile()
11 | printer := NewPrinter(file)
12 | reporter := NewDotReporter(printer)
13 |
14 | reporter.Report(NewSuccessReport())
15 | reporter.Report(NewFailureReport("failed"))
16 | reporter.Report(NewErrorReport(errors.New("error")))
17 | reporter.Report(NewSkipReport())
18 |
19 | expected := dotSuccess + dotFailure + dotError + dotSkip
20 |
21 | if file.buffer != expected {
22 | t.Errorf("\nExpected: '%s'\nActual: '%s'", expected, file.buffer)
23 | }
24 | }
25 |
26 | func TestDotReporterOnlyReportsAssertions(t *testing.T) {
27 | monochrome()
28 | file := newMemoryFile()
29 | printer := NewPrinter(file)
30 | reporter := NewDotReporter(printer)
31 |
32 | reporter.BeginStory(nil)
33 | reporter.Enter(nil)
34 | reporter.Exit()
35 | reporter.EndStory()
36 |
37 | if file.buffer != "" {
38 | t.Errorf("\nExpected: '(blank)'\nActual: '%s'", file.buffer)
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/reporter.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | type Reporter interface {
4 | BeginStory(story *StoryReport)
5 | Enter(scope *ScopeReport)
6 | Report(r *AssertionResult)
7 | Exit()
8 | EndStory()
9 | }
10 |
11 | type reporters struct{ collection []Reporter }
12 |
13 | func (self *reporters) BeginStory(s *StoryReport) { self.foreach(func(r Reporter) { r.BeginStory(s) }) }
14 | func (self *reporters) Enter(s *ScopeReport) { self.foreach(func(r Reporter) { r.Enter(s) }) }
15 | func (self *reporters) Report(a *AssertionResult) { self.foreach(func(r Reporter) { r.Report(a) }) }
16 | func (self *reporters) Exit() { self.foreach(func(r Reporter) { r.Exit() }) }
17 | func (self *reporters) EndStory() { self.foreach(func(r Reporter) { r.EndStory() }) }
18 |
19 | func (self *reporters) foreach(action func(Reporter)) {
20 | for _, r := range self.collection {
21 | action(r)
22 | }
23 | }
24 |
25 | func NewReporters(collection ...Reporter) *reporters {
26 | self := new(reporters)
27 | self.collection = collection
28 | return self
29 | }
30 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/uniuri/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Dmitry Chestnykh
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/launchpad.net/goyaml/LICENSE.libyaml:
--------------------------------------------------------------------------------
1 | Copyright (c) 2006 Kirill Simonov
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/pkg/build/git/git_test.go:
--------------------------------------------------------------------------------
1 | package git
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestGitDepth(t *testing.T) {
8 | var g *Git
9 | var expected int
10 |
11 | expected = DefaultGitDepth
12 | g = nil
13 | if actual := GitDepth(g); actual != expected {
14 | t.Errorf("The result is invalid. [expected: %d][actual: %d]", expected, actual)
15 | }
16 |
17 | expected = DefaultGitDepth
18 | g = &Git{}
19 | if actual := GitDepth(g); actual != expected {
20 | t.Errorf("The result is invalid. [expected: %d][actual: %d]", expected, actual)
21 | }
22 |
23 | expected = DefaultGitDepth
24 | g = &Git{Depth: nil}
25 | if actual := GitDepth(g); actual != expected {
26 | t.Errorf("The result is invalid. [expected: %d][actual: %d]", expected, actual)
27 | }
28 |
29 | expected = 0
30 | g = &Git{Depth: &expected}
31 | if actual := GitDepth(g); actual != expected {
32 | t.Errorf("The result is invalid. [expected: %d][actual: %d]", expected, actual)
33 | }
34 |
35 | expected = 1
36 | g = &Git{Depth: &expected}
37 | if actual := GitDepth(g); actual != expected {
38 | t.Errorf("The result is invalid. [expected: %d][actual: %d]", expected, actual)
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/authcookie/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Dmitry Chestnykh
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dchest/passwordreset/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Dmitry Chestnykh
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/pkg/template/pages/form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ template "title" . }}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 | {{ template "script" . }}
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/oauth1/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Brad Rydzewski
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-github/github/repos_test.go:
--------------------------------------------------------------------------------
1 | package github
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Repos(t *testing.T) {
8 |
9 | repos, err := client.Repos.List()
10 | if err != nil {
11 | t.Error(err)
12 | return
13 | }
14 | if len(repos) == 0 {
15 | t.Errorf("List of repos returned empty set")
16 | }
17 |
18 | // Get the named repo
19 | repo, err := client.Repos.Find(testUser, testRepo)
20 | if err != nil {
21 | t.Error(err)
22 | return
23 | }
24 | if repo.Name != testRepo {
25 | t.Errorf("repo name [%v]; want [%v]", repo.Name, testRepo)
26 | }
27 |
28 | // Get ALL repos, including team repos
29 | repos, err = client.Repos.ListAll()
30 | if err != nil {
31 | t.Error(err)
32 | return
33 | }
34 | if len(repos) == 0 {
35 | t.Errorf("List of ALL repos returned empty set")
36 | }
37 | }
38 |
39 | func Test_ReposFind(t *testing.T) {
40 | client.Repos.Find(testUser, testRepo)
41 | }
42 |
43 | func Test_ReposListOrgs(t *testing.T) {
44 | repos, err := client.Repos.ListOrg("drone")
45 | if err != nil {
46 | t.Error(err)
47 | return
48 | }
49 | if len(repos) == 0 {
50 | t.Errorf("List of repos returned empty set")
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/repositories_test.go:
--------------------------------------------------------------------------------
1 | package gogitlab
2 |
3 | import (
4 | "github.com/stretchr/testify/assert"
5 | "testing"
6 | )
7 |
8 | func TestRepoBranches(t *testing.T) {
9 | ts, gitlab := Stub("stubs/branches/index.json")
10 | branches, err := gitlab.RepoBranches("1")
11 |
12 | assert.Equal(t, err, nil)
13 | assert.Equal(t, len(branches), 1)
14 | defer ts.Close()
15 | }
16 |
17 | func TestRepoBranch(t *testing.T) {
18 | ts, gitlab := Stub("stubs/branches/show.json")
19 | branch, err := gitlab.RepoBranch("1", "master")
20 |
21 | assert.Equal(t, err, nil)
22 | assert.IsType(t, new(Branch), branch)
23 | assert.Equal(t, branch.Name, "master")
24 | defer ts.Close()
25 | }
26 |
27 | func TestRepoTags(t *testing.T) {
28 | ts, gitlab := Stub("stubs/tags/index.json")
29 | tags, err := gitlab.RepoTags("1")
30 |
31 | assert.Equal(t, err, nil)
32 | assert.Equal(t, len(tags), 1)
33 | defer ts.Close()
34 | }
35 |
36 | func TestRepoCommits(t *testing.T) {
37 | ts, gitlab := Stub("stubs/commits/index.json")
38 | commits, err := gitlab.RepoCommits("1")
39 |
40 | assert.Equal(t, err, nil)
41 | assert.Equal(t, len(commits), 2)
42 | defer ts.Close()
43 | }
44 |
--------------------------------------------------------------------------------
/pkg/build/util_test.go:
--------------------------------------------------------------------------------
1 | package build
2 |
3 | import "testing"
4 |
5 | func TestParseImageName(t *testing.T) {
6 | images := []struct {
7 | owner string
8 | name string
9 | tag string
10 | cname string
11 | }{
12 | // full image name with all 3 sections present
13 | {"johnsmith", "redis", "2.8", "johnsmith/redis:2.8"},
14 | // image name with no tag specified
15 | {"johnsmith", "redis", "latest", "johnsmith/redis"},
16 | // image name with no owner specified
17 | {"bradrydzewski", "redis", "2.8", "redis:2.8"},
18 | // image name with ownly name specified
19 | {"bradrydzewski", "redis2", "latest", "redis2"},
20 | // image name that is a known alias
21 | {"relateiq", "cassandra", "latest", "cassandra"},
22 | }
23 |
24 | for _, img := range images {
25 | owner, name, tag := parseImageName(img.cname)
26 | if owner != img.owner {
27 | t.Errorf("Expected image %s with owner %s, got %s", img.cname, img.owner, owner)
28 | }
29 | if name != img.name {
30 | t.Errorf("Expected image %s with name %s, got %s", img.cname, img.name, name)
31 | }
32 | if tag != img.tag {
33 | t.Errorf("Expected image %s with tag %s, got %s", img.cname, img.tag, tag)
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/gotest/utils.go:
--------------------------------------------------------------------------------
1 | // Package gotest contains internal functionality. Although this package
2 | // contains one or more exported names it is not intended for public
3 | // consumption. See the examples package for how to use this project.
4 | package gotest
5 |
6 | import (
7 | "fmt"
8 | "runtime"
9 | "strings"
10 | )
11 |
12 | func FormatExternalFileAndLine() string {
13 | file, line, _ := ResolveExternalCaller()
14 | if line == -1 {
15 | return "" // panic?
16 | }
17 | return fmt.Sprintf("%s:%d", file, line)
18 | }
19 |
20 | func ResolveExternalCaller() (file string, line int, name string) {
21 | var caller_id uintptr
22 | callers := runtime.Callers(0, callStack)
23 |
24 | for x := 0; x < callers; x++ {
25 | caller_id, file, line, _ = runtime.Caller(x)
26 | if strings.HasSuffix(file, "_test.go") {
27 | name = runtime.FuncForPC(caller_id).Name()
28 | return
29 | }
30 | }
31 | file, line, name = "", -1, ""
32 | return // panic?
33 | }
34 |
35 | const maxStackDepth = 100 // This had better be enough...
36 |
37 | var callStack []uintptr = make([]uintptr, maxStackDepth, maxStackDepth)
38 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.text/unicode/norm/maketesttables.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build ignore
6 |
7 | // Generate test data for trie code.
8 |
9 | package main
10 |
11 | import (
12 | "fmt"
13 | )
14 |
15 | func main() {
16 | printTestTables()
17 | }
18 |
19 | // We take the smallest, largest and an arbitrary value for each
20 | // of the UTF-8 sequence lengths.
21 | var testRunes = []rune{
22 | 0x01, 0x0C, 0x7F, // 1-byte sequences
23 | 0x80, 0x100, 0x7FF, // 2-byte sequences
24 | 0x800, 0x999, 0xFFFF, // 3-byte sequences
25 | 0x10000, 0x10101, 0x10FFFF, // 4-byte sequences
26 | 0x200, 0x201, 0x202, 0x210, 0x215, // five entries in one sparse block
27 | }
28 |
29 | const fileHeader = `// Generated by running
30 | // maketesttables
31 | // DO NOT EDIT
32 |
33 | package norm
34 |
35 | `
36 |
37 | func printTestTables() {
38 | fmt.Print(fileHeader)
39 | fmt.Printf("var testRunes = %#v\n\n", testRunes)
40 | t := newNode()
41 | for i, r := range testRunes {
42 | t.insert(r, uint16(i))
43 | }
44 | t.printTables("testdata")
45 | }
46 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Andrew Bonventre
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included
14 | in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/test/tcpip_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !windows
6 |
7 | package test
8 |
9 | // direct-tcpip functional tests
10 |
11 | import (
12 | "net"
13 | "net/http"
14 | "testing"
15 | )
16 |
17 | func TestTCPIPHTTP(t *testing.T) {
18 | // google.com will generate at least one redirect, possibly three
19 | // depending on your location.
20 | doTest(t, "http://google.com")
21 | }
22 |
23 | func TestTCPIPHTTPS(t *testing.T) {
24 | doTest(t, "https://encrypted.google.com/")
25 | }
26 |
27 | func doTest(t *testing.T, url string) {
28 | server := newServer(t)
29 | defer server.Shutdown()
30 | conn := server.Dial(clientConfig())
31 | defer conn.Close()
32 |
33 | tr := &http.Transport{
34 | Dial: func(n, addr string) (net.Conn, error) {
35 | return conn.Dial(n, addr)
36 | },
37 | }
38 | client := &http.Client{
39 | Transport: tr,
40 | }
41 | resp, err := client.Get(url)
42 | if err != nil {
43 | t.Fatalf("unable to proxy: %s", err)
44 | }
45 | // got a body without error
46 | t.Log(resp)
47 | }
48 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/andybons/hipchat/README.md:
--------------------------------------------------------------------------------
1 | Hipchat
2 | =====
3 | This project implements a [Go](http://golang.org) client library for the [Hipchat API](https://www.hipchat.com/docs/api/).
4 |
5 | Pull requests are welcome as the API is limited to only a few calls right now.
6 |
7 | Star this or get at me on the Twitters if you end up using this since this is pretty early stage and I may make breaking changes to the API. – [@andybons](https://www.twitter.com/andybons)
8 |
9 | Installing
10 | ----------
11 | Run
12 | ```bash
13 | go get github.com/andybons/hipchat
14 | ```
15 |
16 | Example usage:
17 | ```go
18 | package main
19 |
20 | import (
21 | "github.com/andybons/hipchat"
22 | "log"
23 | )
24 |
25 | func main() {
26 | c := hipchat.Client{AuthToken: ""}
27 | req := hipchat.MessageRequest{
28 | RoomId: "Rat Man's Den",
29 | From: "GLaDOS",
30 | Message: "Bad news: Combustible lemons failed.",
31 | Color: hipchat.ColorPurple,
32 | MessageFormat: hipchat.FormatText,
33 | Notify: true,
34 | }
35 |
36 | if err := c.PostMessage(req); err != nil {
37 | log.Printf("Expected no error, but got %q", err)
38 | }
39 | }
40 | ```
41 |
--------------------------------------------------------------------------------
/pkg/database/migrate/util.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | import (
4 | "fmt"
5 | "strings"
6 |
7 | "github.com/dchest/uniuri"
8 | )
9 |
10 | func fetchColumns(sql string) ([]string, error) {
11 | if !strings.HasPrefix(sql, "CREATE ") {
12 | return []string{}, fmt.Errorf("Sql input is not a DDL statement.")
13 | }
14 |
15 | parenIdx := strings.Index(sql, "(")
16 | return strings.Split(sql[parenIdx+1:strings.LastIndex(sql, ")")], ","), nil
17 | }
18 |
19 | func selectName(columns []string) []string {
20 | var results []string
21 | for _, column := range columns {
22 | col := strings.SplitN(strings.Trim(column, " \n\t"), " ", 2)
23 | results = append(results, col[0])
24 | }
25 | return results
26 | }
27 |
28 | func setForUpdate(left []string, right []string) string {
29 | var results []string
30 | for k, str := range left {
31 | results = append(results, fmt.Sprintf("%s = %s", str, right[k]))
32 | }
33 | return strings.Join(results, ", ")
34 | }
35 |
36 | func proxyName(tableName string) string {
37 | return fmt.Sprintf("%s_%s", tableName, uniuri.NewLen(16))
38 | }
39 |
40 | func indexName(tableName string, columns []string) string {
41 | return fmt.Sprintf("idx_%s_on_%s", tableName, strings.Join(columns, "_and_"))
42 | }
43 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/fluffle/goirc/client/line_test.go:
--------------------------------------------------------------------------------
1 | package client
2 |
3 | import (
4 | "testing"
5 | "time"
6 | )
7 |
8 | func TestCopy(t *testing.T) {
9 | l1 := &Line{
10 | Nick: "nick",
11 | Ident: "ident",
12 | Host: "host",
13 | Src: "src",
14 | Cmd: "cmd",
15 | Raw: "raw",
16 | Args: []string{"arg", "text"},
17 | Time: time.Now(),
18 | }
19 |
20 | l2 := l1.Copy()
21 |
22 | // Ugly. Couldn't be bothered to bust out reflect and actually think.
23 | if l2.Nick != "nick" || l2.Ident != "ident" || l2.Host != "host" ||
24 | l2.Src != "src" || l2.Cmd != "cmd" || l2.Raw != "raw" ||
25 | l2.Args[0] != "arg" || l2.Args[1] != "text" {
26 | t.Errorf("Line not copied correctly")
27 | t.Errorf("l1: %#v\nl2: %#v", l1, l2)
28 | }
29 |
30 | // Now, modify l2 and verify l1 not changed
31 | l2.Nick = l2.Nick[1:]
32 | l2.Ident = "foo"
33 | l2.Host = ""
34 | l2.Args[0] = l2.Args[0][1:]
35 | l2.Args[1] = "bar"
36 |
37 | if l1.Nick != "nick" || l1.Ident != "ident" || l1.Host != "host" ||
38 | l1.Src != "src" || l1.Cmd != "cmd" || l1.Raw != "raw" ||
39 | l1.Args[0] != "arg" || l1.Args[1] != "text" {
40 | t.Errorf("Original modified when copy changed")
41 | t.Errorf("l1: %#v\nl2: %#v", l1, l2)
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/cmd/droned/assets/test/line_formatter_test.js:
--------------------------------------------------------------------------------
1 | describe("LineFormatter", function() {
2 | it("passes through output without colors", function() {
3 | var lineFormatter = new Drone.LineFormatter();
4 | expect(lineFormatter.format("foo")).toEqual("foo");
5 | });
6 |
7 | it("sets colors", function() {
8 | var lineFormatter = new Drone.LineFormatter();
9 | var input = "\u001B[31;31mthis is red\u001B[0m";
10 | var expected = 'this is red';
11 | expect(lineFormatter.format(input)).toEqual(expected);
12 | });
13 |
14 | it("sets multiple colors", function() {
15 | var lineFormatter = new Drone.LineFormatter();
16 | var input = "\u001B[31;31mthis is red\u001B[0m\u001B[36mthis is cyan\u001B[0m";
17 | var expected = 'this is redthis is cyan';
18 | expect(lineFormatter.format(input)).toEqual(expected);
19 | });
20 |
21 | it("escapes greater than and lesser than symbols", function() {
22 | var lineFormatter = new Drone.LineFormatter();
23 | var input = "";
24 | var expected = '<blink>hello</blink>';
25 | expect(lineFormatter.format(input)).toEqual(expected);
26 |
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/pkg/queue/build_runner.go:
--------------------------------------------------------------------------------
1 | package queue
2 |
3 | import (
4 | "io"
5 | "time"
6 |
7 | "github.com/drone/drone/pkg/build"
8 | "github.com/drone/drone/pkg/build/docker"
9 | "github.com/drone/drone/pkg/build/repo"
10 | "github.com/drone/drone/pkg/build/script"
11 | )
12 |
13 | type BuildRunner interface {
14 | Run(buildScript *script.Build, repo *repo.Repo, key []byte, privileged bool, buildOutput io.Writer) (success bool, err error)
15 | }
16 |
17 | type buildRunner struct {
18 | dockerClient *docker.Client
19 | timeout time.Duration
20 | }
21 |
22 | func NewBuildRunner(dockerClient *docker.Client, timeout time.Duration) BuildRunner {
23 | return &buildRunner{
24 | dockerClient: dockerClient,
25 | timeout: timeout,
26 | }
27 | }
28 |
29 | func (runner *buildRunner) Run(buildScript *script.Build, repo *repo.Repo, key []byte, privileged bool, buildOutput io.Writer) (bool, error) {
30 | builder := build.New(runner.dockerClient)
31 | builder.Build = buildScript
32 | builder.Repo = repo
33 | builder.Key = key
34 | builder.Privileged = privileged
35 | builder.Stdout = buildOutput
36 | builder.Timeout = runner.timeout
37 |
38 | err := builder.Run()
39 |
40 | return builder.BuildState == nil || builder.BuildState.ExitCode != 0, err
41 | }
42 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/rice/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "go/build"
6 | "log"
7 | "os"
8 | )
9 |
10 | func main() {
11 | // parser arguments
12 | parseArguments()
13 |
14 | // find package for path
15 | pkg := pkgForPath(flags.ImportPath)
16 |
17 | // switch on the operation to perform
18 | switch flagsParser.Active.Name {
19 | case "embed":
20 | operationEmbed(pkg)
21 | case "append":
22 | operationAppend(pkg)
23 | case "clean":
24 | operationClean(pkg)
25 | }
26 |
27 | // all done
28 | verbosef("\n")
29 | verbosef("rice finished successfully\n")
30 | }
31 |
32 | // helper function to get *build.Package for given path
33 | func pkgForPath(path string) *build.Package {
34 | // get pwd for relative imports
35 | pwd, err := os.Getwd()
36 | if err != nil {
37 | fmt.Printf("error getting pwd (required for relative imports): %s\n", err)
38 | os.Exit(-1)
39 | }
40 |
41 | // read full package information
42 | pkg, err := build.Import(path, pwd, 0)
43 | if err != nil {
44 | fmt.Printf("error reading package: %s\n", err)
45 | os.Exit(-1)
46 | }
47 |
48 | return pkg
49 | }
50 |
51 | func verbosef(format string, stuff ...interface{}) {
52 | if flags.Verbose {
53 | log.Printf(format, stuff...)
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/users/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "username": "john_smith",
5 | "email": "john@example.com",
6 | "name": "John Smith",
7 | "state": "active",
8 | "created_at": "2012-05-23T08:00:58Z",
9 | "bio": null,
10 | "skype": "",
11 | "linkedin": "",
12 | "twitter": "",
13 | "website_url": "",
14 | "extern_uid": "john.smith",
15 | "provider": "provider_name",
16 | "theme_id": 1,
17 | "color_scheme_id": 2,
18 | "is_admin": false,
19 | "can_create_group": true
20 | },
21 | {
22 | "id": 2,
23 | "username": "jack_smith",
24 | "email": "jack@example.com",
25 | "name": "Jack Smith",
26 | "state": "blocked",
27 | "created_at": "2012-05-23T08:01:01Z",
28 | "bio": null,
29 | "skype": "",
30 | "linkedin": "",
31 | "twitter": "",
32 | "website_url": "",
33 | "extern_uid": "jack.smith",
34 | "provider": "provider_name",
35 | "theme_id": 1,
36 | "color_scheme_id": 3,
37 | "is_admin": false,
38 | "can_create_group": true,
39 | "can_create_project": true
40 | }
41 | ]
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/go.crypto/ssh/kex_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package ssh
6 |
7 | // Key exchange tests.
8 |
9 | import (
10 | "crypto/rand"
11 | "reflect"
12 | "testing"
13 | )
14 |
15 | func TestKexes(t *testing.T) {
16 | type kexResultErr struct {
17 | result *kexResult
18 | err error
19 | }
20 |
21 | for name, kex := range kexAlgoMap {
22 | a, b := memPipe()
23 |
24 | s := make(chan kexResultErr, 1)
25 | c := make(chan kexResultErr, 1)
26 | var magics handshakeMagics
27 | go func() {
28 | r, e := kex.Client(a, rand.Reader, &magics)
29 | c <- kexResultErr{r, e}
30 | }()
31 | go func() {
32 | r, e := kex.Server(b, rand.Reader, &magics, ecdsaKey)
33 | s <- kexResultErr{r, e}
34 | }()
35 |
36 | clientRes := <-c
37 | serverRes := <-s
38 | if clientRes.err != nil {
39 | t.Errorf("client: %v", clientRes.err)
40 | }
41 | if serverRes.err != nil {
42 | t.Errorf("server: %v", serverRes.err)
43 | }
44 | if !reflect.DeepEqual(clientRes.result, serverRes.result) {
45 | t.Errorf("kex %q: mismatch %#v, %#v", name, clientRes.result, serverRes.result)
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/bitbucket.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "errors"
5 | )
6 |
7 | var (
8 | ErrNilClient = errors.New("client is nil")
9 | )
10 |
11 | // New creates an instance of the Bitbucket Client
12 | func New(consumerKey, consumerSecret, accessToken, tokenSecret string) *Client {
13 | c := &Client{}
14 | c.ConsumerKey = consumerKey
15 | c.ConsumerSecret = consumerSecret
16 | c.AccessToken = accessToken
17 | c.TokenSecret = tokenSecret
18 |
19 | c.Keys = &KeyResource{c}
20 | c.Repos = &RepoResource{c}
21 | c.Users = &UserResource{c}
22 | c.Emails = &EmailResource{c}
23 | c.Brokers = &BrokerResource{c}
24 | c.Teams = &TeamResource{c}
25 | c.RepoKeys = &RepoKeyResource{c}
26 | c.Sources = &SourceResource{c}
27 | return c
28 | }
29 |
30 | type Client struct {
31 | ConsumerKey string
32 | ConsumerSecret string
33 | AccessToken string
34 | TokenSecret string
35 |
36 | Repos *RepoResource
37 | Users *UserResource
38 | Emails *EmailResource
39 | Keys *KeyResource
40 | Brokers *BrokerResource
41 | Teams *TeamResource
42 | Sources *SourceResource
43 | RepoKeys *RepoKeyResource
44 | }
45 |
46 | // Guest Client that can be used to access
47 | // public APIs that do not require authentication.
48 | var Guest = New("", "", "", "")
49 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jessevdk/go-flags/unknown_test.go:
--------------------------------------------------------------------------------
1 | package flags
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestUnknownFlags(t *testing.T) {
8 | var opts = struct {
9 | Verbose []bool `short:"v" long:"verbose" description:"Verbose output"`
10 | }{}
11 |
12 | args := []string{
13 | "-f",
14 | }
15 |
16 | p := NewParser(&opts, 0)
17 | args, err := p.ParseArgs(args)
18 |
19 | if err == nil {
20 | t.Fatal("Expected error for unknown argument")
21 | }
22 | }
23 |
24 | func TestIgnoreUnknownFlags(t *testing.T) {
25 | var opts = struct {
26 | Verbose []bool `short:"v" long:"verbose" description:"Verbose output"`
27 | }{}
28 |
29 | args := []string{
30 | "hello",
31 | "world",
32 | "-v",
33 | "--foo=bar",
34 | "--verbose",
35 | "-f",
36 | }
37 |
38 | p := NewParser(&opts, IgnoreUnknown)
39 | args, err := p.ParseArgs(args)
40 |
41 | if err != nil {
42 | t.Fatal(err)
43 | }
44 |
45 | exargs := []string{
46 | "hello",
47 | "world",
48 | "--foo=bar",
49 | "-f",
50 | }
51 |
52 | issame := (len(args) == len(exargs))
53 |
54 | if issame {
55 | for i := 0; i < len(args); i++ {
56 | if args[i] != exargs[i] {
57 | issame = false
58 | break
59 | }
60 | }
61 | }
62 |
63 | if !issame {
64 | t.Fatalf("Expected %v but got %v", exargs, args)
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/stubs/hooks/push.json:
--------------------------------------------------------------------------------
1 | {
2 | "before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
3 | "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
4 | "ref": "refs/heads/master",
5 | "user_id": 4,
6 | "user_name": "John Smith",
7 | "project_id": 15,
8 | "repository": {
9 | "name": "Diaspora",
10 | "url": "git@localhost:diaspora.git",
11 | "description": "",
12 | "homepage": "http://localhost/diaspora"
13 | },
14 | "commits": [
15 | {
16 | "id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
17 | "message": "Update Catalan translation to e38cb41.",
18 | "timestamp": "2011-12-12T14:27:31+02:00",
19 | "url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
20 | "author": {
21 | "name": "Jordi Mallach",
22 | "email": "jordi@softcatala.org"
23 | }
24 | },
25 | {
26 | "id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
27 | "message": "fixed readme",
28 | "timestamp": "2012-01-03T23:36:29+02:00",
29 | "url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
30 | "author": {
31 | "name": "GitLab dev user",
32 | "email": "gitlabdev@dv6700.(none)"
33 | }
34 | }
35 | ],
36 | "total_commits_count": 4
37 | }
38 |
--------------------------------------------------------------------------------
/pkg/database/migrate/20140328201430_add_gitlab_columns.go:
--------------------------------------------------------------------------------
1 | package migrate
2 |
3 | type rev20140328201430 struct{}
4 |
5 | var AddGitlabColumns = &rev20140328201430{}
6 |
7 | func (r *rev20140328201430) Revision() int64 {
8 | return 20140328201430
9 | }
10 |
11 | func (r *rev20140328201430) Up(mg *MigrationDriver) error {
12 | // Migration steps here
13 | if _, err := mg.AddColumn("settings", mg.T.String("gitlab_domain")); err != nil {
14 | return err
15 | }
16 | if _, err := mg.AddColumn("settings", mg.T.String("gitlab_apiurl")); err != nil {
17 | return err
18 | }
19 |
20 | if _, err := mg.Tx.Exec(`update settings set gitlab_domain=?`, "gitlab.com"); err != nil {
21 | return err
22 | }
23 |
24 | if _, err := mg.Tx.Exec(`update settings set gitlab_apiurl=?`, "https://gitlab.com"); err != nil {
25 | return err
26 | }
27 |
28 | if _, err := mg.AddColumn("users", mg.T.String("gitlab_token")); err != nil {
29 | return err
30 | }
31 |
32 | _, err := mg.Tx.Exec(`update users set gitlab_token=?`, "")
33 | return err
34 | }
35 |
36 | func (r *rev20140328201430) Down(mg *MigrationDriver) error {
37 | // Revert migration steps here
38 | if _, err := mg.DropColumns("users", "gitlab_token"); err != nil {
39 | return err
40 | }
41 | _, err := mg.DropColumns("settings", "gitlab_domain", "gitlab_apiurl")
42 | return err
43 | }
44 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/contents.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | type Source struct {
8 | Node string `json:"node"`
9 | Path string `json:"path"`
10 | Data string `json:"data"`
11 | Size int64 `json:"size"`
12 | }
13 |
14 | // Use the Bitbucket src resource to browse directories and view files.
15 | // This is a read-only resource.
16 | //
17 | // https://confluence.atlassian.com/display/BITBUCKET/src+Resources
18 | type SourceResource struct {
19 | client *Client
20 | }
21 |
22 | // Gets information about an individual file in a repository
23 | func (r *SourceResource) Find(owner, slug, revision, path string) (*Source, error) {
24 | src := Source{}
25 | url_path := fmt.Sprintf("/repositories/%s/%s/src/%s/%s", owner, slug, revision, path)
26 |
27 | if err := r.client.do("GET", url_path, nil, nil, &src); err != nil {
28 | return nil, err
29 | }
30 |
31 | return &src, nil
32 | }
33 |
34 | // Gets a list of the src in a repository.
35 | func (r *SourceResource) List(owner, slug, revision, path string) ([]*Source, error) {
36 | src := []*Source{}
37 | url_path := fmt.Sprintf("/repositories/%s/%s/src/%s/%s", owner, slug, revision, path)
38 | if err := r.client.do("GET", url_path, nil, nil, &src); err != nil {
39 | return nil, err
40 | }
41 |
42 | return src, nil
43 | }
44 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.mkd:
--------------------------------------------------------------------------------
1 | go-sqlite3
2 | ==========
3 |
4 | [](https://travis-ci.org/mattn/go-sqlite3)
5 | [](https://coveralls.io/r/mattn/go-sqlite3?branch=master)
6 |
7 | Description
8 | -----------
9 |
10 | sqlite3 driver conforming to the built-in database/sql interface
11 |
12 | Installation
13 | ------------
14 |
15 | This package can be installed with the go get command:
16 |
17 | go get github.com/mattn/go-sqlite3
18 |
19 | Documentation
20 | -------------
21 |
22 | API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
23 |
24 | Examples can be found under the `./_example` directory
25 |
26 | FAQ
27 | ---
28 |
29 | * Can't build go-sqlite3 on windows 64bit.
30 |
31 | > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit.
32 | > See: https://github.com/mattn/go-sqlite3/issues/27
33 |
34 | * Getting insert error while query is opened.
35 |
36 | > You can pass some arguments into the connection string, for example, a URI.
37 | > See: https://github.com/mattn/go-sqlite3/issues/39
38 |
39 | License
40 | -------
41 |
42 | MIT: http://mattn.mit-license.org/2012
43 |
--------------------------------------------------------------------------------
/pkg/build/writer.go:
--------------------------------------------------------------------------------
1 | package build
2 |
3 | import (
4 | //"bytes"
5 | "fmt"
6 | "io"
7 |
8 | "strings"
9 | )
10 |
11 | var (
12 | // the prefix used to determine if this is
13 | // data that should be stripped from the output
14 | prefix = []byte("#DRONE:")
15 | )
16 |
17 | // custom writer to intercept the build
18 | // output
19 | type writer struct {
20 | io.Writer
21 | }
22 |
23 | // Write appends the contents of p to the buffer. It will
24 | // scan for DRONE special formatting codes embedded in the
25 | // output, and will alter the output accordingly.
26 | func (w *writer) Write(p []byte) (n int, err error) {
27 |
28 | lines := strings.Split(string(p), "\n")
29 | for i, line := range lines {
30 |
31 | if strings.HasPrefix(line, "#DRONE:") {
32 | var cmd string
33 |
34 | // extract the command (base16 encoded)
35 | // from the output
36 | fmt.Sscanf(line[7:], "%x", &cmd)
37 |
38 | // echo the decoded command
39 | cmd = fmt.Sprintf("$ %s", cmd)
40 | w.Writer.Write([]byte(cmd))
41 |
42 | } else {
43 | w.Writer.Write([]byte(line))
44 | }
45 |
46 | if i < len(lines)-1 {
47 | w.Writer.Write([]byte("\n"))
48 | }
49 | }
50 |
51 | return len(p), nil
52 | }
53 |
54 | // WriteString appends the contents of s to the buffer.
55 | func (w *writer) WriteString(s string) (n int, err error) {
56 | return w.Write([]byte(s))
57 | }
58 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/davecgh/go-spew/spew/dumpnocgo_test.go:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 Dave Collins
2 | //
3 | // Permission to use, copy, modify, and distribute this software for any
4 | // purpose with or without fee is hereby granted, provided that the above
5 | // copyright notice and this permission notice appear in all copies.
6 | //
7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 |
15 | // NOTE: Due to the following build constraints, this file will only be compiled
16 | // when either cgo is not supported or "-tags testcgo" is not added to the go
17 | // test command line. This file intentionally does not setup any cgo tests in
18 | // this scenario.
19 | // +build !cgo !testcgo
20 |
21 | package spew_test
22 |
23 | func addCgoDumpTests() {
24 | // Don't add any tests for cgo since this file is only compiled when
25 | // there should not be any cgo tests.
26 | }
27 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/keys_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_Keys(t *testing.T) {
8 |
9 | // Test Public key that we'll add to the account
10 | public := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkRHDtJljvvZudiXxLt+JoHEQ4olLX6vZrVkm4gRVZEC7llKs9lXubHAwzIm+odIWZnoqNKjh0tSQYd5UAlSsrzn9YVvp0Lc2eJo0N1AWuyMzb9na+lfhT/YdM3Htkm14v7OZNdX4fqff/gCuLBIv9Bc9XH0jfEliOmfaDMQsbzcDi4usRoXBrJQQiu6M0A9FF0ruBdpKp0q08XSteGh5cMn1LvOS+vLrkHXi3bOXWvv7YXoVoI5OTUQGJjxmEehRssYiMfwD58cv7v2+PMLR3atGVCnoxxu/zMkXQlBKmEyN9VS7Cr8WOoZcNsCd9C6CCrbP5HZnjiE8F0R9d1zjP test@localhost"
11 | title := "test@localhost"
12 |
13 | // create a new public key
14 | key, err := client.Keys.Create(testUser, public, title)
15 | if err != nil {
16 | t.Error(err)
17 | return
18 | }
19 |
20 | // cleanup after ourselves & delete this dummy key
21 | defer client.Keys.Delete(testUser, key.Id)
22 |
23 | // Get the new key we recently created
24 | find, err := client.Keys.Find(testUser, key.Id)
25 | if title != find.Label {
26 | t.Errorf("key label [%v]; want [%v]", find.Label, title)
27 | }
28 |
29 | // Get a list of SSH keys for the user
30 | keys, err := client.Keys.List(testUser)
31 | if err != nil {
32 | t.Error(err)
33 | }
34 |
35 | if len(keys) == 0 {
36 | t.Errorf("List of keys returned empty set")
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/pkg/database/migrate/migration:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | REV=$(date -u +%Y%m%d%H%M%S)
4 | filename=$1
5 |
6 | TAB="$(printf '\t')"
7 |
8 | titleize() {
9 | echo "$1" | sed -r -e "s/-|_/ /g" -e 's/\b(.)/\U\1/g' -e 's/ //g'
10 | }
11 |
12 | howto() {
13 | echo "Usage:"
14 | echo " ./migration create_sample_table"
15 | echo ""
16 | echo "Above invocation will create a migration script called:"
17 | echo " ${REV}_create_sample_table.go"
18 | echo "You can add your migration step at the Up and Down function"
19 | echo "definition inside the file."
20 | echo ""
21 | echo "Database transaction available through MigrationDriver,"
22 | echo "so you can access mg.Tx (sql.Tx instance) directly,"
23 | echo "there are also some migration helpers available, see api.go"
24 | echo "for the list of available helpers (Operation interface)."
25 | echo ""
26 | }
27 |
28 | [[ $# -eq 0 ]] && howto && exit 0
29 |
30 | cat > ${REV}_$filename.go << EOF
31 | package migrate
32 |
33 | type rev${REV} struct{}
34 |
35 | var $(titleize $filename) = &rev${REV}{}
36 |
37 | func (r *rev$REV) Revision() int64 {
38 | ${TAB}return $REV
39 | }
40 |
41 | func (r *rev$REV) Up(mg *MigrationDriver) error {
42 | ${TAB}// Migration steps here
43 | }
44 |
45 | func (r *rev$REV) Down(mg *MigrationDriver) error {
46 | ${TAB}// Revert migration steps here
47 | }
48 | EOF
49 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/tsuru.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "fmt"
5 | "github.com/drone/drone/pkg/build/buildfile"
6 | )
7 |
8 | type Tsuru struct {
9 | Force bool `yaml:"force,omitempty"`
10 | Branch string `yaml:"branch,omitempty"`
11 | Remote string `yaml:"remote,omitempty"`
12 | }
13 |
14 | func (h *Tsuru) Write(f *buildfile.Buildfile) {
15 | // get the current commit hash
16 | f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)")
17 |
18 | // set the git user and email based on the individual
19 | // that made the commit.
20 | f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')")
21 | f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')")
22 |
23 | // add tsuru as a git remote
24 | f.WriteCmd(fmt.Sprintf("git remote add tsuru %s", h.Remote))
25 |
26 | switch h.Force {
27 | case true:
28 | // this is useful when the there are artifacts generated
29 | // by the build script, such as less files converted to css,
30 | // that need to be deployed to Tsuru.
31 | f.WriteCmd(fmt.Sprintf("git add -A"))
32 | f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'"))
33 | f.WriteCmd(fmt.Sprintf("git push tsuru $COMMIT:master --force"))
34 | case false:
35 | // otherwise we just do a standard git push
36 | f.WriteCmd(fmt.Sprintf("git push tsuru $COMMIT:master"))
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/problems_test.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "strings"
5 | "testing"
6 | )
7 |
8 | func TestNoopProblemReporterActions(t *testing.T) {
9 | file, reporter := setup()
10 | reporter.BeginStory(nil)
11 | reporter.Enter(nil)
12 | reporter.Exit()
13 | expected := ""
14 | actual := file.String()
15 | if expected != actual {
16 | t.Errorf("Expected: '(blank)'\nActual: '%s'", actual)
17 | }
18 | }
19 |
20 | func TestReporterPrintsFailuresAndErrorsAtTheEndOfTheStory(t *testing.T) {
21 | file, reporter := setup()
22 | reporter.Report(NewFailureReport("failed"))
23 | reporter.Report(NewErrorReport("error"))
24 | reporter.Report(NewSuccessReport())
25 | reporter.EndStory()
26 |
27 | result := file.String()
28 | if !strings.Contains(result, "Errors:\n") {
29 | t.Errorf("Expected errors, found none.")
30 | }
31 | if !strings.Contains(result, "Failures:\n") {
32 | t.Errorf("Expected failures, found none.")
33 | }
34 | problemCount := strings.Count(result, "*")
35 | if problemCount != 2 {
36 | t.Errorf("Expected one failure and one error (total of 2 '*' characters). Got %d", problemCount)
37 | }
38 | }
39 |
40 | func setup() (file *memoryFile, reporter *problem) {
41 | monochrome()
42 | file = newMemoryFile()
43 | printer := NewPrinter(file)
44 | reporter = NewProblemReporter(printer)
45 | return
46 | }
47 |
--------------------------------------------------------------------------------
/pkg/model/member.go:
--------------------------------------------------------------------------------
1 | package model
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | const (
8 | // Owners can add / remove team members, create / delete projects,
9 | // and have rwx access to all projects owned by the team.
10 | RoleOwner = "Owner"
11 |
12 | // Admins can create / delete projects and have rwx acess
13 | // to all projects owned by the team.
14 | RoleAdmin = "Admin"
15 |
16 | // Write members have rwx access to all projects
17 | // owned by the team. They may not create new projects.
18 | RoleWrite = "Write"
19 |
20 | // Read members have readonly access to all projects
21 | // owned by the team.
22 | RoleRead = "Read"
23 | )
24 |
25 | type Role struct {
26 | ID int64 `meddler:"id,pk"`
27 | TeamID int64 `meddler:"team_id"`
28 | UserID int64 `meddler:"user_id"`
29 | Role string `meddler:"role"`
30 | }
31 |
32 | type Member struct {
33 | ID int64 `meddler:"user_id"`
34 | Name string `meddler:"name"`
35 | Email string `meddler:"email"`
36 | Gravatar string `meddler:"gravatar"`
37 | Role string `meddler:"role"`
38 | }
39 |
40 | // Returns the Gravatar Image URL.
41 | func (m *Member) Image() string { return fmt.Sprintf(GravatarPattern, m.Gravatar, 42) }
42 | func (m *Member) ImageSmall() string { return fmt.Sprintf(GravatarPattern, m.Gravatar, 32) }
43 | func (m *Member) ImageLarge() string { return fmt.Sprintf(GravatarPattern, m.Gravatar, 160) }
44 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/teams.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | const (
4 | TeamRoleAdmin = "admin"
5 | TeamRoleCollab = "collaborator"
6 | )
7 |
8 | // Use this resource to manage privilege settings for a team account. Team
9 | // accounts can grant groups account privileges as well as repository access.
10 | // Groups with account privileges are those with can administer this account
11 | // (admin rights) or can create repositories in this account (collaborator
12 | // rights) checked.
13 | //
14 | // https://confluence.atlassian.com/display/BITBUCKET/privileges+Resource
15 | type TeamResource struct {
16 | client *Client
17 | }
18 |
19 | type Team struct {
20 | // The team or individual account name.
21 | Name string
22 |
23 | // The group's slug.
24 | Role string
25 |
26 | }
27 |
28 | // Gets the groups with account privileges defined for a team account.
29 | func (r *TeamResource) List() ([]*Team, error) {
30 |
31 | // we'll get the data in a key/value struct
32 | data := struct {
33 | Teams map[string]string
34 | }{ }
35 |
36 | data.Teams = map[string]string{}
37 | teams := []*Team{}
38 |
39 | if err := r.client.do("GET", "/user/privileges", nil, nil, &data); err != nil {
40 | return nil, err
41 | }
42 |
43 | for k,v := range data.Teams {
44 | team := &Team{ k, v }
45 | teams = append(teams, team)
46 | }
47 |
48 | return teams, nil
49 | }
50 |
--------------------------------------------------------------------------------
/pkg/build/docker/client_test.go:
--------------------------------------------------------------------------------
1 | package docker
2 |
3 | import (
4 | "io/ioutil"
5 | "os"
6 | "testing"
7 | )
8 |
9 | func TestHostFromEnv(t *testing.T) {
10 | os.Setenv("DOCKER_HOST", "tcp://1.1.1.1:4243")
11 | defer os.Setenv("DOCKER_HOST", "")
12 |
13 | client := New()
14 |
15 | if client.proto != "tcp" {
16 | t.Fail()
17 | }
18 |
19 | if client.addr != "1.1.1.1:4243" {
20 | t.Fail()
21 | }
22 | }
23 |
24 | func TestInvalidHostFromEnv(t *testing.T) {
25 | os.Setenv("DOCKER_HOST", "tcp:1.1.1.1:4243") // missing tcp:// prefix
26 | defer os.Setenv("DOCKER_HOST", "")
27 |
28 | client := New()
29 |
30 | if client.addr == "1.1.1.1:4243" {
31 | t.Fail()
32 | }
33 | }
34 |
35 | func TestSocketHost(t *testing.T) {
36 | // create temporary file to represent the docker socket
37 | file, err := ioutil.TempFile("", "TestDefaultUnixHost")
38 | if err != nil {
39 | t.Fail()
40 | }
41 | file.Close()
42 | defer os.Remove(file.Name())
43 |
44 | client := &Client{}
45 | client.setHost(file.Name())
46 |
47 | if client.proto != "unix" {
48 | t.Fail()
49 | }
50 |
51 | if client.addr != file.Name() {
52 | t.Fail()
53 | }
54 | }
55 |
56 | func TestDefaultTcpHost(t *testing.T) {
57 | client := &Client{}
58 | client.setHost("/tmp/missing_socket")
59 |
60 | if client.proto != "tcp" {
61 | t.Fail()
62 | }
63 |
64 | if client.addr != "0.0.0.0:4243" {
65 | t.Fail()
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/heroku.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "fmt"
5 | "github.com/drone/drone/pkg/build/buildfile"
6 | )
7 |
8 | type Heroku struct {
9 | App string `yaml:"app,omitempty"`
10 | Force bool `yaml:"force,omitempty"`
11 | Branch string `yaml:"branch,omitempty"`
12 | }
13 |
14 | func (h *Heroku) Write(f *buildfile.Buildfile) {
15 | // get the current commit hash
16 | f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)")
17 |
18 | // set the git user and email based on the individual
19 | // that made the commit.
20 | f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')")
21 | f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')")
22 |
23 | // add heroku as a git remote
24 | f.WriteCmd(fmt.Sprintf("git remote add heroku git@heroku.com:%s.git", h.App))
25 |
26 | switch h.Force {
27 | case true:
28 | // this is useful when the there are artifacts generated
29 | // by the build script, such as less files converted to css,
30 | // that need to be deployed to Heroku.
31 | f.WriteCmd(fmt.Sprintf("git add -A"))
32 | f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'"))
33 | f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master --force"))
34 | case false:
35 | // otherwise we just do a standard git push
36 | f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master"))
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.rice/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013, Geert-Johan Riemer
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 | 2. Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/dotcloud/docker/pkg/term/termios_linux.go:
--------------------------------------------------------------------------------
1 | package term
2 |
3 | import (
4 | "syscall"
5 | "unsafe"
6 | )
7 |
8 | const (
9 | getTermios = syscall.TCGETS
10 | setTermios = syscall.TCSETS
11 | )
12 |
13 | type Termios struct {
14 | Iflag uint32
15 | Oflag uint32
16 | Cflag uint32
17 | Lflag uint32
18 | Cc [20]byte
19 | Ispeed uint32
20 | Ospeed uint32
21 | }
22 |
23 | // MakeRaw put the terminal connected to the given file descriptor into raw
24 | // mode and returns the previous state of the terminal so that it can be
25 | // restored.
26 | func MakeRaw(fd uintptr) (*State, error) {
27 | var oldState State
28 | if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 {
29 | return nil, err
30 | }
31 |
32 | newState := oldState.termios
33 |
34 | newState.Iflag &^= (syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON)
35 | newState.Oflag &^= syscall.OPOST
36 | newState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN)
37 | newState.Cflag &^= (syscall.CSIZE | syscall.PARENB)
38 | newState.Cflag |= syscall.CS8
39 |
40 | if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 {
41 | return nil, err
42 | }
43 | return &oldState, nil
44 | }
45 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/discovery.go:
--------------------------------------------------------------------------------
1 | package convey
2 |
3 | func discover(items []interface{}) *registration {
4 | ensureEnough(items)
5 |
6 | name := parseName(items)
7 | test := parseGoTest(items)
8 | action := parseAction(items, test)
9 |
10 | return newRegistration(name, action, test)
11 | }
12 | func ensureEnough(items []interface{}) {
13 | if len(items) < 2 {
14 | panic(parseError)
15 | }
16 | }
17 | func parseName(items []interface{}) string {
18 | if name, parsed := items[0].(string); parsed {
19 | return name
20 | }
21 | panic(parseError)
22 | }
23 | func parseGoTest(items []interface{}) t {
24 | if test, parsed := items[1].(t); parsed {
25 | return test
26 | }
27 | return nil
28 | }
29 | func parseAction(items []interface{}, test t) *action {
30 | var index = 1
31 | if test != nil {
32 | index = 2
33 | }
34 |
35 | if action, parsed := items[index].(func()); parsed {
36 | return newAction(action)
37 | }
38 | if items[index] == nil {
39 | return newSkippedAction(skipReport)
40 | }
41 | panic(parseError)
42 | }
43 |
44 | // This interface allows us to pass the *testing.T struct
45 | // throughout the internals of this tool without ever
46 | // having to import the "testing" package.
47 | type t interface {
48 | Fail()
49 | }
50 |
51 | const parseError = "You must provide a name (string), then a *testing.T (if in outermost scope), and then an action (func())."
52 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/code.google.com/p/gomock/gomock/mock_matcher/mock_matcher.go:
--------------------------------------------------------------------------------
1 | // Automatically generated by MockGen. DO NOT EDIT!
2 | // Source: code.google.com/p/gomock/gomock (interfaces: Matcher)
3 |
4 | package mock_gomock
5 |
6 | import (
7 | gomock "code.google.com/p/gomock/gomock"
8 | )
9 |
10 | // Mock of Matcher interface
11 | type MockMatcher struct {
12 | ctrl *gomock.Controller
13 | recorder *_MockMatcherRecorder
14 | }
15 |
16 | // Recorder for MockMatcher (not exported)
17 | type _MockMatcherRecorder struct {
18 | mock *MockMatcher
19 | }
20 |
21 | func NewMockMatcher(ctrl *gomock.Controller) *MockMatcher {
22 | mock := &MockMatcher{ctrl: ctrl}
23 | mock.recorder = &_MockMatcherRecorder{mock}
24 | return mock
25 | }
26 |
27 | func (_m *MockMatcher) EXPECT() *_MockMatcherRecorder {
28 | return _m.recorder
29 | }
30 |
31 | func (_m *MockMatcher) Matches(_param0 interface{}) bool {
32 | ret := _m.ctrl.Call(_m, "Matches", _param0)
33 | ret0, _ := ret[0].(bool)
34 | return ret0
35 | }
36 |
37 | func (_mr *_MockMatcherRecorder) Matches(arg0 interface{}) *gomock.Call {
38 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Matches", arg0)
39 | }
40 |
41 | func (_m *MockMatcher) String() string {
42 | ret := _m.ctrl.Call(_m, "String")
43 | ret0, _ := ret[0].(string)
44 | return ret0
45 | }
46 |
47 | func (_mr *_MockMatcherRecorder) String() *gomock.Call {
48 | return _mr.mock.ctrl.RecordCall(_mr.mock, "String")
49 | }
50 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/drone/go-bitbucket/bitbucket/repo_keys_test.go:
--------------------------------------------------------------------------------
1 | package bitbucket
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func Test_RepoKeys(t *testing.T) {
8 |
9 | // Test Public key that we'll add to the account
10 | public := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkRHDtJljvvZudiXxLt+JoHEQ4olLX6vZrVkm4gRVZEC7llKs9lXubHAwzIm+odIWZnoqNKjh0tSQYd5UAlSsrzn9YVvp0Lc2eJo0N1AWuyMzb9na+lfhT/YdM3Htkm14v7OZNdX4fqff/gCuLBIv9Bc9XH0jfEliOmfaDMQsbzcDi4usRoXBrJQQiu6M0A9FF0ruBdpKp0q08XSteGh5cMn1LvOS+vLrkHXi3bOXWvv7YXoVoI5OTUQGJjxmEehRssYiMfwD58cv7v2+PMLR3atGVCnoxxu/zMkXQlBKmEyN9VS7Cr8WOoZcNsCd9C6CCrbP5HZnjiE8F0R9d1zjP test@localhost"
11 | title := "test@localhost"
12 |
13 | // create a new public key
14 | key, err := client.RepoKeys.Create(testUser, testRepo, public, title)
15 | if err != nil {
16 | t.Error(err)
17 | return
18 | }
19 |
20 | // cleanup after ourselves & delete this dummy key
21 | defer client.RepoKeys.Delete(testUser, testRepo, key.Id)
22 |
23 | // Get the new key we recently created
24 | find, err := client.RepoKeys.Find(testUser, testRepo, key.Id)
25 | if title != find.Label {
26 | t.Errorf("key label [%v]; want [%v]", find.Label, title)
27 | }
28 |
29 | // Get a list of SSH keys for the user
30 | keys, err := client.RepoKeys.List(testUser, testRepo)
31 | if err != nil {
32 | t.Error(err)
33 | }
34 |
35 | if len(keys) == 0 {
36 | t.Errorf("List of keys returned empty set")
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/jacobsa/oglematchers/transform_description.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Aaron Jacobs. All Rights Reserved.
2 | // Author: aaronjjacobs@gmail.com (Aaron Jacobs)
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | package oglematchers
17 |
18 | // transformDescription returns a matcher that is equivalent to the supplied
19 | // one, except that it has the supplied description instead of the one attached
20 | // to the existing matcher.
21 | func transformDescription(m Matcher, newDesc string) Matcher {
22 | return &transformDescriptionMatcher{newDesc, m}
23 | }
24 |
25 | type transformDescriptionMatcher struct {
26 | desc string
27 | wrappedMatcher Matcher
28 | }
29 |
30 | func (m *transformDescriptionMatcher) Description() string {
31 | return m.desc
32 | }
33 |
34 | func (m *transformDescriptionMatcher) Matches(c interface{}) error {
35 | return m.wrappedMatcher.Matches(c)
36 | }
37 |
--------------------------------------------------------------------------------
/pkg/build/buildfile/buildfile_test.go:
--------------------------------------------------------------------------------
1 | package buildfile
2 |
3 | import (
4 | "testing"
5 | )
6 |
7 | func TestWrite(t *testing.T) {
8 |
9 | var f = New()
10 | var got, want = f.String(), base
11 | if got != want {
12 | t.Errorf("Exepected New() returned %s, got %s", want, got)
13 | }
14 |
15 | f = &Buildfile{}
16 | f.WriteCmd("echo hi")
17 | got, want = f.String(), "echo '#DRONE:6563686f206869'\necho hi\n"
18 | if got != want {
19 | t.Errorf("Exepected WriteCmd returned %s, got %s", want, got)
20 | }
21 |
22 | f = &Buildfile{}
23 | f.WriteCmdSilent("echo hi")
24 | got, want = f.String(), "echo hi\n"
25 | if got != want {
26 | t.Errorf("Exepected WriteCmdSilent returned %s, got %s", want, got)
27 | }
28 |
29 | f = &Buildfile{}
30 | f.WriteComment("this is a comment")
31 | got, want = f.String(), "#this is a comment\n"
32 | if got != want {
33 | t.Errorf("Exepected WriteComment returned %s, got %s", want, got)
34 | }
35 |
36 | f = &Buildfile{}
37 | f.WriteEnv("FOO", "BAR")
38 | got, want = f.String(), "export FOO=BAR\n"
39 | if got != want {
40 | t.Errorf("Exepected WriteEnv returned %s, got %s", want, got)
41 | }
42 |
43 | f = &Buildfile{}
44 | f.WriteHost("127.0.0.1")
45 | got, want = f.String(), "[ -f /usr/bin/sudo ] || echo \"127.0.0.1\" | tee -a /etc/hosts\n[ -f /usr/bin/sudo ] && echo \"127.0.0.1\" | sudo tee -a /etc/hosts\n"
46 | if got != want {
47 | t.Errorf("Exepected WriteHost returned %s, got %s", want, got)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/pkg/plugin/notify/email.go:
--------------------------------------------------------------------------------
1 | package notify
2 |
3 | import "github.com/drone/drone/pkg/mail"
4 |
5 | type Email struct {
6 | Recipients []string `yaml:"recipients,omitempty"`
7 | Success string `yaml:"on_success"`
8 | Failure string `yaml:"on_failure"`
9 | }
10 |
11 | // Send will send an email, either success or failure,
12 | // based on the Commit Status.
13 | func (e *Email) Send(context *Context) error {
14 | switch {
15 | case context.Commit.Status == "Success" && e.Success != "never":
16 | return e.sendSuccess(context)
17 | case context.Commit.Status == "Failure" && e.Failure != "never":
18 | return e.sendFailure(context)
19 | }
20 |
21 | return nil
22 | }
23 |
24 | // sendFailure sends email notifications to the list of
25 | // recipients indicating the build failed.
26 | func (e *Email) sendFailure(context *Context) error {
27 | // loop through and email recipients
28 | for _, email := range e.Recipients {
29 | if err := mail.SendFailure(context.Repo.Name, email, context); err != nil {
30 | return err
31 | }
32 | }
33 | return nil
34 | }
35 |
36 | // sendSuccess sends email notifications to the list of
37 | // recipients indicating the build was a success.
38 | func (e *Email) sendSuccess(context *Context) error {
39 | // loop through and email recipients
40 | for _, email := range e.Recipients {
41 | if err := mail.SendSuccess(context.Repo.Name, email, context); err != nil {
42 | return err
43 | }
44 | }
45 | return nil
46 | }
47 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/GeertJohan/go.incremental/README.md:
--------------------------------------------------------------------------------
1 | ## go.incremental
2 | [](https://drone.io/github.com/GeertJohan/go.incremental/latest)
3 | Go package incremental provides typed incremental counters that are type-safe.
4 |
5 | ### Install
6 | `go get github.com/GeertJohan/go.incremental`
7 |
8 | ### Usage example
9 | This example is also located in the example subdirectory
10 | ```go
11 | package main
12 |
13 | import (
14 | "fmt"
15 | "github.com/GeertJohan/go.incremental"
16 | "runtime"
17 | )
18 |
19 | func main() {
20 | // use max cpu's
21 | runtime.GOMAXPROCS(runtime.NumCPU())
22 |
23 | // create new incremental.Int
24 | i := &incremental.Int{}
25 |
26 | // print some numbers
27 | fmt.Println(i.Next()) // print 1
28 | fmt.Println(i.Next()) // print 2
29 | fmt.Println(i.Next()) // print 3
30 |
31 | // create chan to check if goroutines are done
32 | done := make(chan int)
33 |
34 | // spawn 4 goroutines
35 | for a := 0; a < 4; a++ {
36 | // call goroutine with it's number (0-3)
37 | go func(aa int) {
38 | // print 10 incremental numbers
39 | for b := 0; b < 10; b++ {
40 | fmt.Printf("routine %d: %d\n", aa, i.Next())
41 | }
42 | // signal done
43 | done <- aa
44 | }(a)
45 | }
46 |
47 | // wait until all goroutines are done
48 | for a := 0; a < 4; a++ {
49 | fmt.Printf("goroutine %d done\n", <-done)
50 | }
51 | fmt.Println("all done")
52 | }
53 | ```
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/focused_execution_test.go:
--------------------------------------------------------------------------------
1 | package convey
2 |
3 | import "testing"
4 |
5 | func TestFocusOnlyAtTopLevel(t *testing.T) {
6 | output := prepare()
7 |
8 | FocusConvey("hi", t, func() {
9 | output += "done"
10 | })
11 |
12 | expectEqual(t, "done", output)
13 | }
14 |
15 | func TestFocus(t *testing.T) {
16 | output := prepare()
17 |
18 | FocusConvey("hi", t, func() {
19 | output += "1"
20 |
21 | Convey("bye", func() {
22 | output += "2"
23 | })
24 | })
25 |
26 | expectEqual(t, "1", output)
27 | }
28 |
29 | func TestNestedFocus(t *testing.T) {
30 | output := prepare()
31 |
32 | FocusConvey("hi", t, func() {
33 | output += "1"
34 |
35 | Convey("This shouldn't run", func() {
36 | output += "boink!"
37 | })
38 |
39 | FocusConvey("This should run", func() {
40 | output += "2"
41 |
42 | FocusConvey("The should run too", func() {
43 | output += "3"
44 |
45 | })
46 |
47 | Convey("The should NOT run", func() {
48 | output += "blah blah blah!"
49 | })
50 | })
51 | })
52 |
53 | expectEqual(t, "123", output)
54 | }
55 |
56 | func TestForgotTopLevelFocus(t *testing.T) {
57 | output := prepare()
58 |
59 | Convey("1", t, func() {
60 | output += "1"
61 |
62 | FocusConvey("This will be run because the top-level lacks Focus", func() {
63 | output += "2"
64 | })
65 |
66 | Convey("3", func() {
67 | output += "3"
68 | })
69 | })
70 |
71 | expectEqual(t, "1213", output)
72 | }
73 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/plouc/go-gitlab-client/public_keys_test.go:
--------------------------------------------------------------------------------
1 | package gogitlab
2 |
3 | import (
4 | "github.com/stretchr/testify/assert"
5 | "testing"
6 | )
7 |
8 | func TestGetUserKeys(t *testing.T) {
9 | ts, gitlab := Stub("stubs/public_keys/index.json")
10 | keys, err := gitlab.UserKeys()
11 |
12 | assert.Equal(t, err, nil)
13 | assert.Equal(t, len(keys), 2)
14 | defer ts.Close()
15 | }
16 |
17 | func TestGetUserKey(t *testing.T) {
18 | ts, gitlab := Stub("stubs/public_keys/show.json")
19 | key, err := gitlab.UserKey("1")
20 |
21 | assert.Equal(t, err, nil)
22 | assert.IsType(t, new(PublicKey), key)
23 | assert.Equal(t, key.Title, "Public key")
24 | assert.Equal(t, key.Key, "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=")
25 | defer ts.Close()
26 | }
27 |
28 | func TestAddKey(t *testing.T) {
29 | ts, gitlab := Stub("")
30 | err := gitlab.AddKey("Public key", "stubbed key")
31 |
32 | assert.Equal(t, err, nil)
33 | defer ts.Close()
34 | }
35 |
36 | func TestAddUserKey(t *testing.T) {
37 | ts, gitlab := Stub("")
38 | err := gitlab.AddUserKey("1", "Public key", "stubbed key")
39 |
40 | assert.Equal(t, err, nil)
41 | defer ts.Close()
42 | }
43 |
44 | func TestDeleteKey(t *testing.T) {
45 | ts, gitlab := Stub("")
46 | err := gitlab.DeleteKey("1")
47 |
48 | assert.Equal(t, err, nil)
49 | defer ts.Close()
50 | }
51 |
--------------------------------------------------------------------------------
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/reporting/printer.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | "strings"
7 | )
8 |
9 | type Printer struct {
10 | out io.Writer
11 | prefix string
12 | }
13 |
14 | func (self *Printer) Println(message string, values ...interface{}) {
15 | formatted := self.format(message, values...) + newline
16 | self.out.Write([]byte(formatted))
17 | }
18 |
19 | func (self *Printer) Print(message string, values ...interface{}) {
20 | formatted := self.format(message, values...)
21 | self.out.Write([]byte(formatted))
22 | }
23 |
24 | func (self *Printer) Insert(text string) {
25 | self.out.Write([]byte(text))
26 | }
27 |
28 | func (self *Printer) format(message string, values ...interface{}) string {
29 | var formatted string
30 | if len(values) == 0 {
31 | formatted = self.prefix + message
32 | } else {
33 | formatted = self.prefix + fmt.Sprintf(message, values...)
34 | }
35 | indented := strings.Replace(formatted, newline, newline+self.prefix, -1)
36 | return strings.TrimRight(indented, space)
37 | }
38 |
39 | func (self *Printer) Indent() {
40 | self.prefix += pad
41 | }
42 |
43 | func (self *Printer) Dedent() {
44 | if len(self.prefix) >= padLength {
45 | self.prefix = self.prefix[:len(self.prefix)-padLength]
46 | }
47 | }
48 |
49 | func NewPrinter(out io.Writer) *Printer {
50 | self := new(Printer)
51 | self.out = out
52 | return self
53 | }
54 |
55 | const space = " "
56 | const pad = space + space
57 | const padLength = len(pad)
58 |
--------------------------------------------------------------------------------
/pkg/plugin/deploy/git.go:
--------------------------------------------------------------------------------
1 | package deploy
2 |
3 | import (
4 | "fmt"
5 | "github.com/drone/drone/pkg/build/buildfile"
6 | )
7 |
8 | type Git struct {
9 | Target string `yaml:"target,omitempty"`
10 | Force bool `yaml:"force,omitempty"`
11 | Branch string `yaml:"branch,omitempty"`
12 | }
13 |
14 | func (g *Git) Write(f *buildfile.Buildfile) {
15 | // get the current commit hash
16 | f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)")
17 |
18 | // set the git user and email based on the individual
19 | // that made the commit.
20 | f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')")
21 | f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')")
22 |
23 | // add target as a git remote
24 | f.WriteCmd(fmt.Sprintf("git remote add deploy %s", g.Target))
25 |
26 | destinationBranch := g.Branch
27 | if destinationBranch == "" {
28 | destinationBranch = "master"
29 | }
30 |
31 | switch g.Force {
32 | case true:
33 | // this is useful when the there are artifacts generated
34 | // by the build script, such as less files converted to css,
35 | // that need to be deployed to git remote.
36 | f.WriteCmd(fmt.Sprintf("git add -A"))
37 | f.WriteCmd(fmt.Sprintf("git commit -m 'add build artifacts'"))
38 | f.WriteCmd(fmt.Sprintf("git push deploy $COMMIT:%s --force", destinationBranch))
39 | case false:
40 | // otherwise we just do a standard git push
41 | f.WriteCmd(fmt.Sprintf("git push deploy $COMMIT:%s", destinationBranch))
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/pkg/plugin/notify/notification.go:
--------------------------------------------------------------------------------
1 | package notify
2 |
3 | import (
4 | "github.com/drone/drone/pkg/model"
5 | )
6 |
7 | // Context represents the context of an
8 | // in-progress build request.
9 | type Context struct {
10 | // Global settings
11 | Host string
12 |
13 | // User that owns the repository
14 | User *model.User
15 |
16 | // Repository being built.
17 | Repo *model.Repo
18 |
19 | // Commit being built
20 | Commit *model.Commit
21 | }
22 |
23 | type Sender interface {
24 | Send(context *Context) error
25 | }
26 |
27 | // Notification stores the configuration details
28 | // for notifying a user, or group of users,
29 | // when their Build has completed.
30 | type Notification struct {
31 | Email *Email `yaml:"email,omitempty"`
32 | Webhook *Webhook `yaml:"webhook,omitempty"`
33 | Hipchat *Hipchat `yaml:"hipchat,omitempty"`
34 | Irc *IRC `yaml:"irc,omitempty"`
35 | Slack *Slack `yaml:"slack,omitempty"`
36 | }
37 |
38 | func (n *Notification) Send(context *Context) error {
39 | // send email notifications
40 | if n.Email != nil {
41 | n.Email.Send(context)
42 | }
43 |
44 | // send email notifications
45 | if n.Webhook != nil {
46 | n.Webhook.Send(context)
47 | }
48 |
49 | // send email notifications
50 | if n.Hipchat != nil {
51 | n.Hipchat.Send(context)
52 | }
53 |
54 | // send irc notifications
55 | if n.Irc != nil {
56 | n.Irc.Send(context)
57 | }
58 |
59 | // send slack notifications
60 | if n.Slack != nil {
61 | n.Slack.Send(context)
62 | }
63 |
64 | return nil
65 | }
66 |
--------------------------------------------------------------------------------
/pkg/database/database.go:
--------------------------------------------------------------------------------
1 | package database
2 |
3 | import (
4 | "database/sql"
5 | "fmt"
6 |
7 | "github.com/drone/drone/pkg/database/migrate"
8 |
9 | _ "github.com/go-sql-driver/mysql"
10 | _ "github.com/mattn/go-sqlite3"
11 |
12 | "github.com/russross/meddler"
13 | )
14 |
15 | // global instance of our database connection.
16 | var db *sql.DB
17 |
18 | // Init connects to database and performs migration if necessary.
19 | //
20 | // Database driver name and data source information is provided by user
21 | // from within command line, and error checking is deferred to sql.Open.
22 | //
23 | // Init will just bail out and returns error if driver name
24 | // is not listed, no fallback nor default driver sets here.
25 | func Init(name, datasource string) error {
26 | var err error
27 | driver := map[string]struct {
28 | Md *meddler.Database
29 | Mg migrate.DriverBuilder
30 | }{
31 | "sqlite3": {
32 | meddler.SQLite,
33 | migrate.SQLite,
34 | },
35 | "mysql": {
36 | meddler.MySQL,
37 | migrate.MySQL,
38 | },
39 | }
40 |
41 | if drv, ok := driver[name]; ok {
42 | meddler.Default = drv.Md
43 | migrate.Driver = drv.Mg
44 | } else {
45 | return fmt.Errorf("%s driver not found", name)
46 | }
47 |
48 | db, err = sql.Open(name, datasource)
49 | if err != nil {
50 | return err
51 | }
52 |
53 | migration := migrate.New(db)
54 | if err := migration.All().Migrate(); err != nil {
55 | return err
56 | }
57 | return nil
58 | }
59 |
60 | // Close database connection.
61 | func Close() {
62 | db.Close()
63 | }
64 |
--------------------------------------------------------------------------------
/pkg/template/pages/admin_users.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Users · Sysadmin{{ end }}
2 |
3 | {{ define "content" }}
4 |
5 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
Manage all users in the System.
24 |
46 |
47 |
48 |
49 |
50 | {{ end }}
51 |
52 | {{ define "script" }}
53 | {{ end }}
--------------------------------------------------------------------------------