Sunday, December 28, 2014

Coding and Deploying Apps in the Cloud using Cloud9/GitHub/Google

My goal today was to code something in Go and deploy it in the Cloud as fast and easy as possible.

Preliminary Remarks / State of Knowledge

  • I already have a little experience coding little Python apps from Codenvy and then using their integration to deploy it on Google App Engine. That works. Unfortunately Go on App Engine seems in Beta status and Codenvy doesn't offer integration yet.
  • I know that Google is currently in a transitional phase integrating their (limited but easy to understand and use) App Engine and (versatile but hard to understand and use) Compute Engine services under the Cloud Platform umbrella.
  • I briefly checked out Cloud9 and liked it.
  • I don't care about public visibility of the code for this project.

Choice

The following integration seems promising:
Cloud9   <-- (1) -->   GitHub   <-- (2) -->   App Engine.

Here Cloud9 serves as the IDE to develop, GitHub as the code storage and App Engine as the deployment environment.

Walkthrough


1. Create a Google Cloud Platform Project.

2. Create a GitHub Project.
3. Connect the two (using the Google Developers Console).

4. Connect Cloud9 and GitHub (from the Cloud9 Dashboard).
5. Connect GitHub and Cloud9 by cloning the existing GitHub project inside Cloud9 (we could also do it vice versa).
  
6. Develop, e.g. in Go!

7. Upload the changes to GitHub (add new files, check the difference, commit the new files, update the remote server):
git add foo/*
git status
git commit -a -m "some changes"
git push

If all is well then the Cloud9-developed files should show up in the Google Developer Console!


8. Install the App Engine SDK inside Cloud9.
cd ~
mkdir appengine_sdk_go
cd  appengine_sdk_go
wget https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.17.zip
unzip go_appengine_sdk_linux_amd64-1.9.17.zip 
echo "PATH=/home/ubuntu/appengine_sdk_go/go_appengine/:$PATH" >> ~/.bashrc
source ~/.bashrc

9. Set up an application-specific password for the app by creating one at https://security.google.com/settings/security/apppasswords .

10. Push the code to serving from the Cloud9 commandline using
$ goapp deploy find_home/
When being prompted, enter your Gmail email and the application-specific password.

The code should now be serving at http://find-home-in-go.appspot.com/ !

1 comment:

  1. Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many. ripple blockchain jobs

    ReplyDelete