Objective-C in the Cloud

Deployment

Deploying your cloud applications to Objective-Cloud is done by using git.

The Objective-Cloud Workflow

Getting to know the Objective-Cloud workflow is not critical but it is good to know how everything is supposed to be happening: From the creation of a cloud application to the actual deployment process.

  • The life of a cloud application usually starts at Objective-Cloud Connect. For each cloud application which is created via Objective-Cloud Connect a corresponding git repository is created for you automatically.
  • Shortly after the git repository has been created we initialize it with an Xcode project that is preconfigured to work with your credentials out of the box.
  • The initial Xcode project also includes a helloworld! example. The initial push of the Xcode project causes the app to be deployed automatically. This is why you can use your cloud application immediately after you have created it.
  • You are then supposed to clone the git repository, modify and test it locally.
  • Once you are satisfied with how everything works locally you initiate the deployment process by pushing your changes to the remote repository. You can do this from the command line by using git push or by using Xcode (use the Source Control | Push… menu item).
  • Your changes are received by Objective-Cloud and the actual deployment process begins.
  • The first thing that Objective-Cloud does is trying to build your cloud application. Building your cloud application is a process that can take between 10 seconds and about 10 minutes. This depends on the current load of the build server.
  • If your cloud application was built successfully it is launched and is now ready to receive requests.

Building your Cloud Application

Building your cloud application is part of the deployment process.

Environment

We build your cloud application in a virtual machine with the following environment:

  • OS X 10.9
  • Xcode 5 with command line tools installed
  • The current Objective-Cloud frameworks (OCFoundation, OCFJSONCoding, OCFWeb and OCFWebServer) are available and your application will be linked against them.

When building your cloud application we automatically set the build setting called OBJECTIVE_CLOUD_APPLICATION_NAME.

You should not change the value of this build setting. It will break things. We may decide to not deploy your application of this build setting is not correct.

How we build your app

Your app is build by using xcodebuild like so:

xcodebuild -sdk macosx10.9 install \
           -configuration Release \
           -allTargets \
           OBJECTIVE_CLOUD_APPLICATION_NAME=$yourApp  \
           CONFIGURATION_BUILD_DIR=~/Desktop \
           FRAMEWORK_SEARCH_PATHS=$path_to_objective-cloud-frameworks \
           OBJROOT=~/obj \
           SYMROOT=~/sym \
           DSTROOT=~/dst \
           | tee xcodebuild.log

This means several things:

  • Your app has to be compatible with the new Mac OS X 10.9 SDK.
  • We are building all of your targets. The default template we provide does only contain a single target (your cloud app). If you add additional targets they will be built as well. If they do not build they break the build and your app won't be deployed.
  • We automatically link dynamically against the latest version of the Objective-Cloud frameworks. You should have them installed already.
  • If you want to use third party frameworks you are free to do so. You simply have to modify your target so that it includes all third party frameworks you need.