-
Notifications
You must be signed in to change notification settings - Fork 0
Bluemix
patrikfr edited this page Oct 21, 2014
·
12 revisions
Deployment instructions for Bluemix by IBM
Blumix is IBM's implementation of the Cloud Foundry platform. It provides a free tier, making it a good place to start your PaaS journey!
- Create an IBM id.
- Install the cf command line tool for your platform.
Execute the following commands from the command line:
-
cf api https://api.ng.bluemix.net
to connect to the Bluemix API. - Login to Bluemix:
cf login -u <your-bluemix-id> -o <your-bluemix-id> -s dev
This will log you in to your default organization and space, read more about organizations and spaces in the documentation. The CLI will prompt you for your password.
Build and package the application.
- Create a new working directory for Bluemix on a directory of your choice, we will refer to it as
<notes-bm>
below. - Copy the
ROOT.war
from above to<notes-bm>/
. - Change dir:
cd /path/to/<notes-bm>
. - Push the WAR-file as a new app. The name you give the app must be globally unique, so pick something good; replace with the name you choose:
cf push <name-notes> -m 512m -p ROOT.war
. This will upload the WAR-file and create the app, but it will not start correctly since there is no database. Let's fix that! - Create the mongodb service:
cf create-service mongodb 100 mongodb-notes
- Bind it to our new app:
cf bind-service <name-notes> mongodb-notes
- Restart the application:
cf restage <name-notes>
At this point the application will be restarted, watch console output to track progress.
BOOM! And you're done!
You should now be able to access the application at http://<notes-name>.mybluemix.net
. Open the page in your web browser to view the application, and then, take some notes.
For further details of the platform, see the IBM Bluemix Docs.
It's also possible to create the services and upload the WAR file using the web GUI at http://blumemix.net.
- Do a Blue/Green deployment for zero downtime
- Attach a manifest.yml file with your deploy and bind to the MongoDB service, making it unnecessary to restart the application after your deploy.
- Try deploy in one terminal window and tailing the logs in another (
cf logs <notes-name>
to see what is happening during deploy. - Login to the GUI at https://bluemix.net and try to recreate the deploy using the GUI.