phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

Adobe PhoneGap Build API not creating signing keys #617

Closed jonhue closed 6 years ago

jonhue commented 6 years ago

I haven't received any comments in the forum. It's been 5 days since posting the original question.

I am following the Adobe PhoneGap Build API Docs to create an android signing key for an app programmatically.

def add_keystore
     phonegap_token = 'ABCDEFG'
    android_keystore = download_key 'android_keystore', @app.android_keystore
    phonegap_android_key_error = JSON.parse(HTTParty.post("https://build.phonegap.com/api/v1/keys/android?auth_token=#{phonegap_token}", body: { keystore: android_keystore, data: {
        title: @app.slug + ' - Android Key',
        alias: @app.android_key_alias,
        key_pw: @app.android_key_password,
        keystore_pw: @app.android_keystore_password
    } }, format: :plain), symbolize_names: true)[:error]
    raise phonegap_android_key_error.inspect
end

private

def download_key path, url
    response = HTTParty.get url
    f = Tempfile.new path
    f.binmode
    f.write response.body
    f.flush
    f.close
    f
end

But PhoneGap always returns the error: "#<File:0x000000065c1290> is not a file"

I've also tried to set the android_keystore variable to the Carrierwave File @app.android_keystore.file - resulting in the same error.

goya commented 6 years ago

does HTTParty even support file uploads?