Cloud Source Repositories

Cloud Source Repositories, fully-managed private Git repositories hosted on Google Cloud Platform (GCP), is tightly integrated with other GCP tools, making it easy to automatically build, test, deploy, and debug code right out of the gate. With just a few clicks and without any additional setup or configuration, you can extend Cloud Source Repositories with other GCP tools to perform other tasks as a part of your development workflow. In this post, let’s take a closer look at some of the GCP tools that are integrated with Cloud Source Repositories, and how they simplify developer workflows:



 669  mkdir GCP
  670  cd GCP
  671  echo "ketan" > ketan.txt
  672  cd
  673  ssh-keygen -t rsa -C "ketan.patel@supernal.aero"
  674  cd .ssh
  675  ls -l
  676  cat id_rsa.pub
  677  cd
  678  cd GCP
  679  ls -l
  683  gcloud init
  685  gcloud source repos create azureketanvm1
  686  git remote add google https://source.developers.google.com/p/new-user-learning/r/azureketanvm1
  687  gcloud config list
  688  git remote -v
  689  git init
  690  ls
  691  ls -al
  692  git remote -v
  693  git remote add google https://source.developers.google.com/p/new-user-learning/r/azureketanvm1
  694  git remote -v
  695  git push google master
  696  git add .
  697  git status
  698  git commit -m "first commit"
  699  git status






ketan@ketanvm1:~$ mkdir GCP

ketan@ketanvm1:~$ cd GCP

ketan@ketanvm1:~/GCP$ echo "ketan" > ketan.txt

ketan@ketanvm1:~/GCP$ cd

ketan@ketanvm1:~$ ssh-keygen -t rsa -C "ketan.patel@supernal.aero"

Generating public/private rsa key pair.
Enter file in which to save the key (/home/ketan/.ssh/id_rsa):
/home/ketan/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ketan/.ssh/id_rsa
Your public key has been saved in /home/ketan/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:b86nJiB/53fki2BJg6X8RCiL3C165/it+n2vhP2Ueq8 ketan.patel@supernal.aero
The key's randomart image is:
+---[RSA 3072]----+
|                 |
|         .       |
|      . . o      |
|   . o = =       |
|    o + S +      |
|    .... = =  .. |
|    .o... O ooo  |
|     ..+oBoo+=+  |
|      o==*B=+=E+.|
+----[SHA256]-----+
ketan@ketanvm1:~$

ketan@ketanvm1:~$ cd .ssh

ketan@ketanvm1:~/.ssh$ ls -l
total 8
-rw------- 1 ketan ketan    0 Jun 23 17:17 authorized_keys
-rw------- 1 ketan ketan 2610 Aug 21 22:28 id_rsa
-rw-r--r-- 1 ketan ketan  579 Aug 21 22:28 id_rsa.pub

ketan@ketanvm1:~/.ssh$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC91i4eEYr4W/utQkKYZqJgQHxizCUisbbKRPsd5eRC                                                     O6uIubn7DEVP58SptnbSRQWswhkiuu6UITDGIv7iyF1Drih+abxQlWQugJ9ZUQgi8ljqY+wZR9icYoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXkLjwnErfx0A3PDGizncvuJkI2ZbhZbk+fJyCSeSiM= ketan.p atel@supernal.aero

ketan@ketanvm1:~/.ssh$ cd

ketan@ketanvm1:~$ cd GCP

ketan@ketanvm1:~/GCP$ ls -l
total 4
-rw-rw-r-- 1 ketan ketan 6 Aug 21 22:27 ketan.txt


ketan@ketanvm1:~/GCP$ gcloud init

Welcome! This command will take you through the configuration of gcloud.

Settings from your current configuration [default] are:
compute:
  region: us-west1
  zone: us-west1-a
core:
  account: ketan.patel@supernal.aero
  disable_usage_reporting: 'True'
  project: new-user-learning

Pick configuration to use:
 [1] Re-initialize this configuration [default] with new settings
 [2] Create a new configuration
Please enter your numeric choice:  1

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

Choose the account you would like to use to perform operations for this configuration:
 [1] ketan.patel@supernal.aero
 [2] Log in with a new account
Please enter your numeric choice:  1

You are logged in as: [ketan.patel@supernal.aero].

Pick cloud project to use:
 [1] cosmic1234abcd
 [2] dv1234
 [3] dvabcd
 [4] new-user-learning

 [5] Enter a project ID
 [6] Create a new project
Please enter numeric choice or text value (must exactly match list item):  4

Your current project has been set to: [new-user-learning].

Do you want to configure a default Compute Region and Zone? (Y/n)?  Y

Which Google Compute Engine zone would you like to use as project default?
If you do not specify a zone via a command line flag while working with Compute Engine resources, the default is assumed.
 [1] us-east1-b
<truncated>
 [10] us-central1-b
 [11] us-west1-b
 [12] us-west1-c
 [13] us-west1-a
<truncated>
Did not print [66] options.
Too many options [116]. Enter "list" at prompt to print choices fully.
Please enter numeric choice or text value (must exactly match list item):  13

Your project default Compute Engine zone has been set to [us-west1-a].
You can change it by running [gcloud config set compute/zone NAME].

Your project default Compute Engine region has been set to [us-west1].
You can change it by running [gcloud config set compute/region NAME].

Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use ketan.patel@supernal.aero by default
* Commands will reference project `new-user-learning` by default
* Compute Engine commands will use region `us-west1` by default
* Compute Engine commands will use zone `us-west1-a` by default

Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting
* Run `gcloud cheat-sheet` to see a roster of go-to `gcloud` commands.



ketan@ketanvm1:~/GCP$ git config --global credential.'https://source.developers.google.com'.helper gcloud.sh

ketan@ketanvm1:~/GCP$ gcloud source repos create azureketanvm1
Created [azureketanvm1].
WARNING: You may be billed for this repository. See https://cloud.google.com/source-repositories/docs/pricing for details.




ketan@ketanvm1:~/GCP$ git init
Initialized empty Git repository in /home/ketan/GCP/.git/

ketan@ketanvm1:~/GCP$ ls -al
total 16
drwxrwxr-x  3 ketan ketan 4096 Aug 21 22:36 .
drwxr-xr-x 23 ketan ketan 4096 Aug 21 22:34 ..
drwxrwxr-x  7 ketan ketan 4096 Aug 21 22:36 .git
-rw-rw-r--  1 ketan ketan    6 Aug 21 22:27 ketan.txt

ketan@ketanvm1:~/GCP$ git remote -v

ketan@ketanvm1:~/GCP$ git remote add google https://source.developers.google.com/p/new-user-learning/r/azureketanvm1

ketan@ketanvm1:~/GCP$ git remote -v
google  https://source.developers.google.com/p/new-user-learning/r/azureketanvm1 (fetch)
google  https://source.developers.google.com/p/new-user-learning/r/azureketanvm1 (push)


ketan@ketanvm1:~/GCP$ git add .

ketan@ketanvm1:~/GCP$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   ketan.txt

ketan@ketanvm1:~/GCP$ git commit -m "first commit"
[master (root-commit) df7e485] first commit
 1 file changed, 1 insertion(+)
 create mode 100644 ketan.txt

ketan@ketanvm1:~/GCP$ git status
On branch master
nothing to commit, working tree clean

ketan@ketanvm1:~/GCP$ git push google master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 217 bytes | 217.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Waiting for private key checker: 1/1 objects left
To https://source.developers.google.com/p/new-user-learning/r/azureketanvm1
 * [new branch]      master -> master
ketan@ketanvm1:~/GCP$







UPDATE CURRENT DIRECTORY AND PUSH IT:

ketan@ketanvm1:~/GCP$ echo patel > patel
ketan@ketanvm1:~/GCP$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        patel

nothing added to commit but untracked files present (use "git add" to track)
ketan@ketanvm1:~/GCP$ git add .
ketan@ketanvm1:~/GCP$ git commit -m "second commit"
[master e2955bd] second commit
 1 file changed, 1 insertion(+)
 create mode 100644 patel
ketan@ketanvm1:~/GCP$ git status
On branch master
nothing to commit, working tree clean
ketan@ketanvm1:~/GCP$ git push google master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 277 bytes | 277.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Waiting for private key checker: 1/1 objects left
To https://source.developers.google.com/p/new-user-learning/r/azureketanvm1
   df7e485..e2955bd  master -> master
ketan@ketanvm1:~/GCP$




No comments:

Post a Comment

AppEngine - Python

tudent_04_347b5286260a@cloudshell:~/python-docs-samples/appengine/standard_python3/hello_world (qwiklabs-gcp-00-88834e0beca1)$ sudo apt upda...