It’s now easier than ever to deploy your apps to the cloud using IBM Cloud Tools for Swift (ICT). With the release of version 1.3, Mac users have an even simpler interface for deploying, managing and monitoring end-to-end applications. The improved Swift application makes using the Swift@IBM server-side tools and technologies super easy. Download the Beta version here. Then take these 4 simple steps to learn how to navigate our new UI.
1. Start a new Project
Click the “+” in the upper right hand corner of the application from the Projects view, the default view when you load the application.
Figure 1. Create New Project
You will see several options for new projects including sample apps and an empty project. The sample apps are built on Kitura, a web framework created by IBM for writing Swift on the Server. An empty project allows you to add your existing projects to ICT, so you can manage and monitor them within the app.
Figure 2. Project Options
2. Create the ToDo List sample app locally
The ToDo List sample app is a great way to learn how to write Swift on the client and the server. Hover over ToDo List App and click View.
Figure 3. View Project
You will see a description of the project, a ReadMe, and information for local development. In previous versions of ICT, you deployed to the cloud immediately, but now you can save files locally to view and test before pushing the application to IBM Cloud.
Figure 4. Project ReadMe
Double check to make sure you meet the local development requirements (Xcode 8 in this case), then click Save Files to Local Computer.
Name the project then click Next. Note: your project name should not have spaces in it. You will get an error if it does.
Figure 5. Name Project
Choose where to save the project files and click Place. Note: the folder name should not have spaces in it. You will get an error if there are spaces in the path.
Figure 6. Place Project
This will bring you to a screen with Local Server Repositories, Cloud Runtimes, and Client Apps.
A Local Server Repository is your server side code that you can run locally. A Cloud Runtime is a cloud application hosted on IBM Cloud with your server side code. A Client App is your front end code that talks to your server, for example ToDo List Sample comes with an iOS app.
Figure 7. Files Saved
Run the project in Xcode to get it working locally!
3. Deploy the ToDo List Sample App to the Cloud
From the project view, click on Provision and Deploy Sample Server on IBM Cloud.
Figure 8. Deploy to IBM Cloud
If you haven’t signed in to IBM Cloud, you will be prompted to sign in. If you do not have an IBM ID, sign up for one and get started with your free 30-day trial. Note: you will need to set up your Region, Org and Spaces before returning to ICT.
Figure 9. Sign In to IBM Cloud
If you have multiple orgs, you will be prompted to choose which one you’d like to put the Cloud Runtime.
Figure 10. Migrate Projects to Orgs
Check that you meet all the IBM Cloud requirements for creating a Cloud Runtime then click next. You can look at your memory usage and current services by going to the IBM Cloud web UI.
Figure 11. IBM Cloud Project Requirements
Give a unique name for your Cloud Runtime and select a Space then click Next.
Figure 12. Name Cloud Runtime
You will be brought back to the project screen, but this time you will have a Cloud Runtime loading!
Figure 13. Loading Cloud Runtime
ICT automatically creates a Cloud Runtime and a Cloudant Database on IBM Cloud for you, this may take a few minutes, but you will receive a notification once it’s complete.
Open the client app in Xcode to run your app with an IBM Cloud Runtime.
You can now switch between running your client app locally and remotely by changing the Connected to: field on the client app. This is helpful for quickly testing code changes before you deploy to IBM Cloud.
Figure 14. Connected To
On the Local Server Repository card, you’ll see a Deploy to: field.
Figure 15. Deploy To
This allows you to choose where you deploy your server-side code if you have multiple Cloud Runtimes associated with your project. You may have this if you choose to set up testing, staging and production environments for your application.
4. Checkout your Cloud Runtime Logs
To view logs and errors of your Cloud Runtime, click Open Logs on the Cloud Runtime card.
Figure 16. Logs
To learn more about this feature, read our instructions.
ICT offers other advanced features like creating a custom project from a sample application hosted in github. To learn more about that feature, check out our instructions on how to create a supported manifest.yml file.
Get Support and Provide Feedback
If you haven’t already done so, download the latest version of ICT. If you have questions along the way, reach out to us through dWAnswers. If you have any feedback, fill out our survey to help us improve the tool. Stay up to date on IBM initiatives around Swift by visiting our website.