Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sync Asset Bundles from Unity Cloud to S3

Discussion in 'Unity Build Automation' started by doggan, Mar 13, 2016.

  1. doggan

    doggan

    Joined:
    Aug 12, 2012
    Posts:
    23
    Hello.

    What is the recommended approach to uploading asset bundles built with Unity Cloud to Amazon S3?

    After looking through the documentation and forums, I see some people asking similar questions, but the way to do this is unclear to me.

    I've successfully built the asset bundles with Unity Cloud. Looking at the logs, the asset bundles are output to 'AssetBundles/iOS/...', but I'm not sure how to handle the next step.

    - I originally tried to integrate the AWS Mobile SDK and perform the s3 sync via PostProcessBuild or Post-Export Method, but I had issues getting the AWS SDK to run in the Unity Editor. It also was a LOT of code and dependencies to add to our project, just for the purpose of syncing assets during the build process, so I wanted to avoid this.

    - My current thought is to have a separate service running (on heroku for example), which will download the asset bundles from 'AssetBundles/iOS/...' and then perform an s3 sync. Does this seem like a valid approach? One thing I am stuck on with this approach is how to actually access the asset bundle contents of the cloud build at 'AssetBundles/iOS/...' from a remote server. I don't see any documentation about this. I guess another approach would be to zip up the files in Post-Export, and POST them to my remote server, then the remote server unzips and does the sync.. hmm...

    Ideally this will be something that Unity will support in the near future (;)), but until then, any guidance would be super helpful.

    Thanks.
     
  2. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    Currently, asset bundles are just copied to StreamingAssets/ as part of the build and aren't being hosted independently, so there would be no way to get them through the API.

    If you want to go the post-export route, you will need to make sure that all of your requests are synchronous. I have not tested this myself, but I would probably recommend using the .NET HTTP classes to make synchronous requests to upload the asset bundles to your server and have the server do the sync.
     
  3. doggan

    doggan

    Joined:
    Aug 12, 2012
    Posts:
    23
    Ok, thanks for the reply. I'll try that method and see what happens.

    I'm assuming it's just functionality that you guys haven't gotten to yet, but count it as a feature request! :) It looks like you're already hosting the built IPA on S3, so giving us some hooks to directly sync our assets to S3 would be a welcome addition.

    Thanks again.