Friday, May 22, 2015

Step 2: Getting Your Project to Work on Eclipse and Bluemix

This is the second step out of three that you need to follow to complete this project. In this step, you will be downloading source code and getting your project to work both locally on Eclipse and on Bluemix. Follow the directions below:

1. Create a folder in finder where you will store your project
2. Using Github to acquire source code
  • Go to http://github.com and create an account
  • Go to https://github.com/astopera/cognitive-showcase/tree/startingpoint and click fork
  • Copy the HTTPS Clone URL on the right 
  • Go to SourceTree and under file, click new/clone
  • Under new repository, click Clone From URL and paste the HTTPS Clone URL you copied before
  • Create a new folder to store this source code in (its logical to store it in the folder you created above in #1)
  • Before clicking clone, go to advanced options and change the checkout branch to starting point
  • Double click on the new repository you have created in SourceTree
  • Click on the Terminal icon on the top of SourceTree window
  • In Terminal, type gradle eclipse
  • Now in Eclipse, go to file->import
  • Choose Existing Projects in Workspace and then browse for the folder where you saved your copied code, then click finish
  • The code you copied should now be imported into your Eclipse
3. Getting your code to work locally
  • In Eclipse, go to the servers tab at the bottom
  • Right click on the server you created in step 1 and click on Add and Remove
  • Under this, add the project you just created to the server
  • Right click on the server again and press Start
  • The server should start and the window should switch to console
  • Under console, click on the link that contains local host to take you to your page 
4. Pushing your code to Bluemix
  • In Eclipse, open your manifest.yml file
  • In this file, delete the two AWPs and replace them with the name you gave your personality insights service when you created it in Bluemix in step 1 
  • In Bluemix, create a new web application using Liberty for Java
  • Once created, go into the service and choose Bind A Service OR API
  • Choose the service with the name you used above
  • In the manifest.yml, change "name" to be the name of the application you created
  • In Terminal, type gradle build and then hit enter
  • Then type cf push project name (for example in my video, I named my project "foldertest")
  • If this works, go to Bluemix and open the application you created before 
  • There will be a link at the top, click on this and this should open the web portal you created

No comments:

Post a Comment