# 本地端應用透過 Google Cloud 達到持續交付

簡報連結


# Self Introduction


# 持續交付 Continous Delivery

Continous Delivery = CI (Continous Integration) 持續整合 + CD (Continous Deployment) 持續部屬

他們是在將撰寫完的程式流程自動化,前者負責整合的部分,後者負責部屬的部分。


# 本次主角 Cloud Build (CI 工具)

特色

  • 有免費額度 支援多種語言
  • 可以整合很多其他 GCP 服務 (今天與 Cloud Run 整合)
  • 使用 yaml 檔案設置

# 實作環節


節省時間 這裡有個專案大家嘗試一下

記得 Install Google Cloud SDK

1
2
3
4
5
git clone git@gitlab.com:fan9704/flaskgcpcloudbuildtocloudrun.git
#進入專案且設置Google Cloud Project
cd flaskgcpcloudbuildtocloudrun
# 初始化本專案成 Gcloud 專案
gcloud init

# 安裝套件 requirements.txt


# 簡單的 API main.py


# 簡單的測試 main_test.py


# 都寫好了 包裝成 Docker Image


# OK Cloud Build CI/CD 流水線建置起來



# 好了就 build 吧

1
2
#丟上去
gcloud builds submit --config cloudbuild.yaml .


# GCP 頁面查看 pipeline


# Cloud Run Service 啟動成功


# 實際應用程式


# Thanks Everyone

I am FKT
We are NYUST GDSC
Discord Link


# Error Artifact Registry 沒建置起來

1
2
3
4
5
6
7
8
#1. 專案帳單帳戶設置
#2. 沒有放docker image的artifact registry
gcloud artifacts repositories create docker-repo --repository-format=docker --location=us-central1 --description="docker repository"
#改一下cloud build yaml的artifact registry repo變成docker-repo
#3. Cloud RUN API 沒開啟
#4. Artifact Registry API沒開啟
#5. Compute Engine API 沒開啟
#6. IAM Cloud Build帳號權限 Cloud Run Admin