Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2015 20:58
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A gradle task to upload android build artifacts to dropbox
task pushDropbox << {
def outName;
if (System.getenv("GITLAB_CI")) {
outName = "app-debug-${System.getenv("CI_BUILD_REF_NAME")}-SNAPSHOT.apk"
} else {
outName = "app-debug.apk"
def artifact = project.file('build/outputs/apk/app-debug.apk')
def client = new RESTClient('')
def response =
path : "/1/files_put/auto/Company/Project/apk/${outName}",
body : artifact.bytes,
query: [overwrite: true, autorename: false],
headers: ['Authorization': 'Bearer <TOKEN>'],
requestContentType: ContentType.BINARY)
assert response.status == 200
pushDropbox.dependsOn assembleDebug
Copy link

Hey man thank you for the script but whenever I use it, it always give me Unauthorized
i use the aouth2 generated in dropbox
Any idea why this is happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment