GCP Resources - vidyasekaran/GCP GitHub Wiki
NOTE: Important note
https://spring.io/projects/spring-cloud-gcp
Spring Cloud GCP is no longer part of the Spring Cloud release train. The new repository location is https://github.com/GoogleCloudPlatform/spring-cloud-gcp. Check out the migration guide to upgrade from version 1.x to 2.0.0.
https://www.roitraining.com/course-838-architecting-systems-in-the-cloud/
https://www.youtube.com/watch?v=N_tFyuQw0Ws
https://cloud.google.com/icons/ (click on draw.io at the bottom which opens draw.io in screen) https://app.diagrams.net/?splash=0&libs=gcp
- drag /drop and create the diagram and export it as pdf, png, jpeg etc...
draw.io code and windows/linux installers (you can install in windows as desktop version) https://github.com/jgraph/drawio-desktop
https://codelabs.developers.google.com/spring?hl=en
Features Spring Cloud GCP offers a wide collection of libraries that make it easier to use Google Cloud Platform from Spring Framework applications.
https://spring.io/projects/spring-cloud-gcp
https://cloud.google.com/products/tools
The repository also contains code samples to help you develop your application. https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples
https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app#cloud-shell_1
Downloaded App Engine and installed - https://cloud.google.com/sdk/docs/install youtube link follwed - https://www.youtube.com/watch?v=0zJUK-SwPqQ
https://cloud.google.com/sdk/docs/cheatsheet
https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-data-datastore https://stackoverflow.com/questions/51358617/upload-a-file-to-google-cloud-storage-java
https://github.com/GoogleCloudPlatform/spring-cloud-gcp
https://github.com/spring-cloud/spring-cloud-gcp
@ShellComponent - That informs Spring that we want to use this class as a source for CLI commands. The methods annotated with @ShellMethod will be exposed as CLI commands in our application.
Example Code:
@ShellComponent @SpringBootApplication public class DemoApplication {
@ShellMethod("Saves a book to Cloud Datastore: save-book <title> ") public String saveBook(String title, String author, int year) { Book savedBook = this.bookRepository.save(new Book(title, author, year)); return savedBook.toString(); }
When you run the code you will get Shell
$ ./mvnw spring-boot:run
shell:>
shell:> help (list all commands for the java source code) find-all-books: Loads all books find-by-author: Loads books by author: find-by-author find-by-author-year: Loads books by author and year: find-by-author-year find-by-year-after: Loads books published after a given year: find-by-year-after remove-all-books: Removes all books save-book: Saves a book to Cloud Datastore: save-book <title>
Use Jib to create the container image and push it to the Container Registry
./mvnw -DskipTests com.google.cloud.tools:jib-maven-plugin:build -Dimage=gcr.io/$GOOGLE_CLOUD_PROJECT/hello-java:v1
https://github.com/spring-cloud
Examples with Documentation https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample
This link has better explanation about using service account https://dzone.com/articles/bootiful-gcp-to-production-88
https://docs.spring.io/spring-cloud-gcp/docs/1.0.0.M1/reference/htmlsingle/
https://cloud.google.com/docs/authentication/production#auth-cloud-explicit-java
https://docs.spring.io/spring-cloud-gcp/docs/1.0.0.M1/reference/htmlsingle/
-
Create a repository and also setup ssh in gcp refer : https://cloud.google.com/source-repositories/docs/authentication#generate_a_key_pair
-
Add a new repository myrepo in local E:\workspace\myrepo and from gcp - https://source.cloud.google.com/repos
-
You will be show below steps Refer *notes
-
open 2 command prompt 1 for git clone from git example : https://github.com/vidyasekaran/spring-cloud-gcp-1 and another to git clone ssh://duvarakan1948@[email protected]:2022/p/iaptest-328809/r/myrepo
-
copy the folder you cloned from git (E:\workspace\new-gcp-repository\spring-cloud-gcp-1) and paste it in E:\workspace\myrepo
-
now from E:\workspace\myrepo do
git remote show origin (to see origin points to GCR)
git add .
git status
E:\workspace\myrepo>git commit -m "test"
E:\workspace\myrepo>git push -u origin master
- Now setup this project in STS E:\workspace\myrepo\spring-cloud-gcp-storage
*notes
Clone this repository to a local Git repository: Clone with command line $ git clone ssh://duvarakan1948@[email protected]:2022/p/iaptest-328809/r/myrepo
Or clone with VS Code Clone Note: This may display the following message that is safe to ignore: "warning: You appear to have cloned an empty repository." Switch to your new local Git repository: $ cd myrepo
After you've committed code to your local Git repository, push it to this repository: $ git push -u origin master
https://github.com/vidyasekaran/spring-cloud-gcp-1
https://xenovation.com/blog/source-control-management/git/how-to-change-remote-git-repository
https://git-scm.com/docs/git-push
https://cloud.google.com/source-repositories/docs
https://cloud.google.com/source-repositories/docs/adding-repositories-as-remotes#windows