> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Development and CICD Summary

> Guide summarizing using Google Cloud SDK and gcloud CLI, practicing commands, and using Cloud Build for automated CI/CD pipelines to build, test, and deploy applications to Cloud Run

Hello everyone — welcome back.\
Before we move on, here’s a concise, structured recap of deploying CI/CD on Google Cloud. This summary focuses on three core areas you’ll use most often: the Google Cloud SDK and its CLI, practicing the `gcloud` commands, and Cloud Build as the serverless CI/CD platform.

## 1) Google Cloud SDK and the gcloud CLI

The Google Cloud SDK is your primary toolbox for managing GCP. It bundles command-line utilities that let you configure projects, manage services, deploy applications, and inspect logs from the terminal. The `gcloud` command is the central interface for these tasks.

Why this matters:

* Centralized CLI reduces context switching between different consoles.
* Scripts and automation rely on `gcloud` for reproducible deployments and admin tasks.
* SDK includes specialized tools for common services.

Common SDK tools:

| Tool      | Purpose                                                       | Example                                                   |
| --------- | ------------------------------------------------------------- | --------------------------------------------------------- |
| `gcloud`  | Primary CLI for managing projects, IAM, deployments, and more | `gcloud config set project PROJECT_ID`                    |
| `gsutil`  | Cloud Storage operations (upload, download, list)             | `gsutil ls gs://my-bucket`                                |
| `bq`      | BigQuery queries and dataset/table management                 | `bq query 'SELECT COUNT(*) FROM `my\_dataset.my\_table`'` |
| `kubectl` | Kubernetes cluster management (GKE)                           | `kubectl get pods`                                        |

Install the SDK to get these tools locally and use them consistently across environments. See the official installation guide: [Google Cloud SDK](https://cloud.google.com/sdk/docs/install).

## 2) Practicing the gcloud CLI

Practice is essential — these are the commands you’ll use daily and during exams. Work through routine workflows (auth, project selection, storage, BigQuery, Kubernetes) until they become second nature.

Quick reference commands:

```bash theme={null}
# Authenticate with Google Cloud
gcloud auth login

# Set the active project
gcloud config set project PROJECT_ID

# Interact with Cloud Storage
gsutil ls gs://my-bucket

# Interact with BigQuery
bq query 'SELECT COUNT(*) FROM `my_dataset.my_table`'

# Interact with Kubernetes clusters (GKE)
kubectl get pods
```

Tip: Use scripts and CI/CD steps that call these commands to automate repetitive tasks and reduce manual errors.

## 3) Cloud Build — serverless CI/CD for GCP

Cloud Build is Google Cloud’s serverless CI/CD engine. It executes build steps defined in a `cloudbuild.yaml` or `cloudbuild.json` to build, test, push, and deploy artifacts. Cloud Build integrates with source repos (GitHub, Cloud Source Repositories) and triggers automated pipelines on events like push or pull request.

What Cloud Build does for you:

* Builds container images and other artifacts.
* Runs automated tests and linters.
* Pushes images to Artifact Registry or Container Registry.
* Deploys artifacts to Cloud Run, GKE, App Engine, or other targets.

<Callout icon="lightbulb" color="#1CB2FE">
  Exam and practical tip: focus on three areas — the SDK and its specialized tools, mastery of `gcloud` for everyday tasks, and how Cloud Build uses `cloudbuild.yaml` to automate build/test/deploy pipelines. Knowing how these pieces connect is key to reliable CI/CD on GCP.
</Callout>

## Practical example: Deploying a Streamlit app with Cloud Build

Scenario: a data scientist stores a Streamlit app in GitHub and wants an automated deploy to Cloud Run. As the platform engineer or data engineer, you’d implement a repeatable workflow that builds, tests, stores the image, and deploys.

Typical workflow:

* Store app code in a GitHub repo.
* Create `cloudbuild.yaml` to:
  * Build a Docker image.
  * Run tests (if any).
  * Push the image to Artifact Registry or Container Registry.
  * Deploy to Cloud Run.
* Configure a Cloud Build trigger on the GitHub repo to run builds on push/PR.
* Use `gcloud` for initial setup and troubleshooting.

High-level commands to run locally or in automation:

```bash theme={null}
# Log in and set project (run locally once)
gcloud auth login
gcloud config set project PROJECT_ID

# Submit a local build using the cloudbuild.yaml (optional)
gcloud builds submit --config=cloudbuild.yaml .

# Deploy a built image to Cloud Run
gcloud run deploy my-streamlit-app \
  --image=gcr.io/PROJECT_ID/my-streamlit-image \
  --platform=managed \
  --region=us-central1 \
  --allow-unauthenticated
```

This represents the typical flow:
source code → Cloud Build (build & test) → Artifact/Container Registry → Cloud Run (deploy).

## References and further reading

* [Google Cloud SDK (gcloud) Documentation](https://cloud.google.com/sdk/docs)
* [Cloud Build Overview](https://cloud.google.com/build/docs/overview)
* [Cloud Run Documentation](https://cloud.google.com/run/docs)
* [Artifact Registry](https://cloud.google.com/artifact-registry/docs)
* [Cloud Storage (gsutil) docs](https://cloud.google.com/storage/docs/gsutil)

That’s it for this summary — see you next time.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/google-cloud-professional-data-engineer-certification/module/02c15300-8e2a-455b-9032-0d4630391b66/lesson/8da6f2c1-80dd-436b-9fd2-57a3b17eeb1c" />
</CardGroup>
