Hello everyone, Come and see you again. In the previous article, I showed you the basic steps to familiarize yourself with a fairly new application deployment platform of Google, Google App Engine (GAE). And also showed you the basic steps to deploy a Ruby application to GAE using GAE’s tool editor, CloudShell.
Today, I will show you how to install the SDK so that you can execute Google commands on your local Linux machine.
Let’s start!
This article I predict is quite short, because the steps to make this job quite simple. I will try to put the necessary notes here. And in the following article, I will show you how to configure SSL for the domain and perfect the product on this server
Install the SDK
Almost forgot -The prerequisite to practice here is that you must use Ubuntu, have created App Engine on Google Cloud and have clone repo the project to your local
In the project foder:
- Step1:
You must add the Cloud SDK distribution URI to the project package using the command line:
1 2 3 | echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list |
- Step2:
Import the public cloud key of Google cloud flatform as well
1 2 3 | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - |
- Step3:
Update the package and install the SDK
1 2 3 | sudo apt-get update && sudo apt-get install google-cloud-sdk |
Usually google has a few backup cases installed here, you can refer
- TH1: You cannot access the latest versions of the recently installed junk, you can visit here to get that heap with apt-get.gpg
- TH2: If your distribution apt-key doesn’t support the –keyring argument, run the following commands:
1 2 | echo "deb http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list |
1 2 | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
1 2 | sudo apt-get update && sudo apt-get install google-cloud-sdk |
So the bunch of miscellaneous has been installed. Now I started to manipulate directly with the SDK
- Step4:
1 2 | gcloud init |
This command line starts to install the SDK into your local PC and directly connects it to the GAE account you are accessing. Follow the steps below is okie
After running the command, your console terminal will confirm the other steps, starting with
1 2 | To continue, you must log in. Would you like to log in (Y/n)? Y |
You choose Y (Yes)
It is confirming the GAE login in the browser and allowing the installation of the redundant SDK.
After that, it confirms that you choose the specific app engine:
1 2 3 4 5 6 | Pick cloud project to use: [1] [my-project-1] [2] [my-project-2] ... Please enter your numeric choice: |
In this step, you only need to select the number of the engine you will deploy the application to.
Next is to choose computer zone
1 2 3 4 5 6 7 | Which compute zone would you like to use as project default? [1] [asia-east1-a] [2] [asia-east1-b] ... [14] Do not use default zone Please enter your numeric choice: |
This I don’t know where you are, so find out for yourself: v
After that, it confirms you succeed, the console is left:
1 2 3 4 5 | gcloud has now been configured! You can use [gcloud config] to change more gcloud settings. Your active configuration is: [default] |
Basically, here you have successfully installed the SDK. To check, you can run simple commands like gcloud info, gcoud help...
The remaining thing to deploy is that you need to configure the things related to the secret key, env … Maybe this section I will say in the last post: Deploy and SSL for the Domain. And the scope of this article on installing SDK I think it’s okie already. Deliberately
Thank you for watching the post. I synthesized documents from the original page and other fake documents, so please excuse me from the source.