mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 10:07:21 +02:00
added code to ignore S3 builds when no access key or secret provided
This commit is contained in:
parent
3ac36b9e89
commit
3a22094484
@ -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
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user