How do I upload a zip file from bamboo ondemand to confluence ondeman

I attempted to do this with a python script that I run as the final step of plan but the script just hangs. Does anyone have an ideas on what I have done wrong in my script? I do see the artifcate and able to download it manually.

This is what my code looks like


from __future__ import with_statement
import sys, string, xmlrpclib, re, os, logging

logging.warning('running upload-attachment') 

    #Space key of the page where you want to attach the file. For example, "KEY".
spacekey = 'SIM';

    #Page title of the page where you want to attach the file. The page must already exist. You may need to escape or quote special characters in the file name. For example, "Page title".
pagetitle = "Simpoint Downloads";

    #Content type of the attachment. See below for more information about content types. For example, "text/plain".
contentType = 'application/zip';

    #File name of the file to attach. This will also be used as the name of the attachment within Confluence. For example, "somefile.txt".
filename = 'simpoint/package/target/';

logging.warning('opening file') 
with open(filename, 'rb') as f:
    data =; # slurp all the data

logging.warning('after openning file') 
server = xmlrpclib.ServerProxy('');
logging.warning('after server connect') 

token = server.confluence1.login('MyUser', 'MyPassword');
logging.warning('after login') 

page = server.confluence1.getPage(token, spacekey, pagetitle);

if page is None:
    exit("Could not find page " + spacekey + ":" + pagetitle);

attachment = {};
attachment['fileName'] = os.path.basename(filename);
attachment['contentType'] = contentType;

logging.warning('before addAttachment') 
server.confluence1.addAttachment(token, page['id'], attachment, xmlrpclib.Binary(data));
logging.warning('after addAttachment')

3 answers

Bamboo for automatic uploads to Confluence is another way to solve this problem :), but only if you are host your own Bamboo :(.

thanks, but I am using ondemand confluence and ondemand bamboo. Any suggestions on how I can solve this problem with that setup?

does anyone have a suggestion for me?

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,066 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot