未加星标

Introducing Google Cloud Shell’s new code editor

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二03 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

We’ve heard from a lot of Google Cloud Platform (GCP) users that they like to edit code and configuration files without leaving their browser. We're now making that easier by offering a new feature: an integrated code editor.

The new code editor is based on Eclipse Orion , and is part of Google Cloud Shell ,a command line interface to manage GCP resources. You can access Cloud Shell via the browser from any computer with an internet connection, and it comes with the Cloud SDK and other essential tools pre-installed. The VM backing Cloud Shell is temporary, but each user gets 5GB of persistent storage for files and projects.

To open the new Cloud Shell code editor:

Go to the Google Cloud Console Click on the Cloud Shell icon on the top right section of the toolbar
Introducing Google Cloud Shell’s new code editor
Open the code editor from the Cloud Shell toolbar. You’ll also notice that we’ve introduced the ability to upload and download files from your Cloud Shell home directory.
Introducing Google Cloud Shell’s new code editor
Start editing your code and configuration files.
Introducing Google Cloud Shell’s new code editor
Cloud Shell code editor in action

Here's an example of how you can use the Cloud Shell code editor to create a sample app, push your changes to Google Cloud Source Repository , deploy the app to Google App Engine Standard, and use Stackdriver Debugger :

Create a sample app On the Cloud Console website, select an existing project or create a new one from the toolbar. Open Cloud Shell and the code editor as described above and create a new folder (File->New->Folder). Name it ‘helloworldapp’. Inside the helloworldapp folder, create a new file and name it ‘app.yaml’. Paste the following:
runtime: python27 api_version: 1 threadsafe: yes handlers: - url: .* script: main.app libraries: - name: webapp2 version: "2.5.2" Create another file in the same directory, name it ‘main.py’, and paste the following:
#!/usr/bin/env python import webapp2 class MainHandler(webapp2.RequestHandler): def get(self): self.response.write('Hello world!') app = webapp2.WSGIApplication([ ('/', MainHandler) ], debug=True) Save your source code in Cloud Source Repositories Switch to the tab with the open shell pane and go to your app’s directory:
cd helloworldapp Initialize git and your repo. The first two steps aren't necessary if you've done them before:

git config --global user.email " [email protected] "

git config --global user.name "Your Name"

git init

git add . -A

git commit -m "Initial commit"

Authorize Git to access GCP:
git config credential.helper gcloud.sh Add the repository as a remote named ‘google’ to your local Git repository, first replacing [PROJECT_ID] with the name of your Cloud project:
git remote add google https://source.developers.google.com/p/[PROJECT_ID]/r/default
git push google master Deploy to App Engine From the ~/helloworldapp directory, type: gcloud app deploy app.yaml Type ‘Y’ to confirm Visit your newly deployed app at https://[PROJECT_ID].appspot.com Use Stackdriver Debugger

You can now go to the Debug page , take a snapshot and debug incoming traffic without actually stopping the app.

Open main.py and click on a line number to set the debug snapshot location Refresh the website displaying the hello world page, and you'll see the request snapshot taken in the debugger Note that the Debug page displays the source code version of your deployed app Summary

Now you know how to use Cloud Shell and the code editor to write a sample app, push it into a cloud source repository, deploy it to App Engine Standard, and debug it with Stackdriver Debugger

all without leaving your browser. Note that the new Cloud Shell code editor is just a first step toward making Cloud Shell developers’ go-to environment for everything from simple DevOps tasks to end-to-end software development. We welcome your feedback (click on the gear icon in Shell toolbar->Send Feedback) on how to improve Google Cloud Shell. Stay tuned for new features and functionality.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: GitSG5G
分页:12
转载请注明
本文标题:Introducing Google Cloud Shell’s new code editor
本站链接:http://www.codesec.net/view/484729.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(25)