S3 and slack plugins fail for PR builds

Currently on drone-0.8
Having a repo with hooks for Push and PR. Builds with Push build fine, uploads work and build errors are notified on slack.

However with the PR the s3 and slack plugins seem to fail somehow.

Same configuration for the PR we see with s3:

time="2018-01-29T14:19:12Z" level=info msg="Attempting to upload" bucket=nrcbuilds endpoint= region=eu-west-1
time="2018-01-29T14:19:12Z" level=error msg="Could not match files" error="file does not exist" 
file does not exist

And slack:

Post : unsupported protocol scheme "" 

Our basic config:

    image: nrc/centos67-python-node:latest
    pull: true
    - mkdir builds/
    - ./make_tarball_in_builds_dir.sh

    image: plugins/s3
    bucket: nrcbuilds
    acl: private
    region: eu-west-1
    source: builds/${DRONE_COMMIT_SHA}.tar.gz
    target: github.com/nrcmedia/front/${DRONE_COMMIT_BRANCH}
    strip_prefix: builds/
      owner: nrcmedia

    image: plugins/slack
    secrets: [ SLACK_WEBHOOK ]
    channel: "#ourdevroom"
    username: Drone
      status: [ failure ]

It sounds like your secrets are not configured for pull requests. Please see the following:

If you continue to experience issues please provide all five requested items here:

^ ah great!

I made the necessary changes to our provisioning and the slack messages now are sent using the secret. However the s3 plugin still gives the same error:

time="2018-01-30T09:19:35Z" level=info msg="Attempting to upload" bucket=nrcbuilds endpoint= region=eu-west-1 
time="2018-01-30T09:19:35Z" level=error msg="Could not match files" error="file does not exist" 
file does not exist

Same yaml as above.


mkdir -p builds
mv /tmp/086e010fb7ba8e2dc8d37a69bb408d27315b8322.tar.gz builds/086e010fb7ba8e2dc8d37a69bb408d27315b8322.tar.gz


Events: push, pull_request
Images: <any>

Events: push, pull_request
Images: <any>

Events: push, pull_request
Images: <any>

repo info:

Owner: nrcmedia
Repo: front
Type: git
Config: .drone.yml
Visibility: private
Private: true
Trusted: false
Gated: false
Remote: https://github.com/nrcmedia/front.git

build info:

Number: 1457
Status: failure
Event: pull_request
Commit: cd276aa5c31e03b0daeae1b16a7d28f3ec3cc98e
Branch: master
Ref: refs/pull/1874/merge
Message: Feature/drone update
Author: dromer


Now that I look at it I see there is a different commit-hash for the build as compared to what the s3 plugin wants to upload.

We derive this hash in our Makefile with:

COMMIT := $(shell git rev-parse HEAD)


So, it seems to be that drone pulls a different commit than what is referenced in the build.

The code that is pulled comes from the merge of the PR, whereas the referenced DRONE_COMMIT_SHA is for the commit that triggered the PR-build.

I would expect the later to reference the actual SHA that is used in the build, not the trigger.

Ok, for now I’m going to exclude the s3-upload on PRs using

    event: [push, tag, deployment]

Most important for us is that the code is tested/built.

After the actual merge event it should be built/uploaded for deployment anyway.