added code to ignore S3 builds when no access key or secret provided

This commit is contained in:
Brad Rydzewski 2014-02-11 15:44:39 -07:00
parent 3ac36b9e89
commit 3a22094484
2 changed files with 13 additions and 0 deletions

View file

@ -1,5 +1,10 @@
image: go1.2
env:
- GOROOT=/usr/local/go
- GOPATH=/var/cache/drone
- PATH=$GOPATH/bin:$GOPATH/bin:$PATH
script:
- sudo apt-get -y install libsqlite3-dev sqlite3 mercurial bzr 1> /dev/null 2> /dev/null
- make deps
- make
- make test

View file

@ -51,6 +51,14 @@ type S3 struct {
}
func (s *S3) Write(f *buildfile.Buildfile) {
// skip if AWS key or SECRET are empty. A good example for this would
// be forks building a project. S3 might be configured in the source
// repo, but not in the fork
if len(s.Key) == 0 || len(s.Secret) == 0 {
return
}
// install the AWS cli using PIP
f.WriteCmdSilent("[ -f /usr/bin/sudo ] || pip install awscli 1> /dev/null 2> /dev/null")
f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo pip install awscli 1> /dev/null 2> /dev/null")