GitHub - 아직 인증되지 않은 경우 인증을 클릭하고 안내를 따릅니다. 기본적으로 저장소 연결은 Cloud Build GitHub 앱을 통해 수행됩니다. 또는 Cloud Source Repositories에서 GitHub 저장소를 미러링할 수 있습니다. 이렇게 하려면 고급 옵션을 클릭하고 Cloud Source Repositories를 사용한 GitHub 저장소 미러링을 선택합니다.
자세히 알아보기
브랜치 - 트리거를 실행할 때 사용할 소스를 나타냅니다. 여기에 정규식을 입력할 수 있습니다. 일치하는 브랜치가 자동으로 확인되며 입력 아래에 표시됩니다. 정확히 브랜치 하나가 일치하면 트리거가 생성된 후 자동으로 실행됩니다.
빌드 유형
Docker를 사용하여 저장소를 빌드해야 하는 경우 Dockerfile이 포함되어 있으면 Dockerfile을 선택합니다. 소스 위치는 Dockerfile의 위치와 이름을 나타냅니다. 이 디렉터리는 Docker 빌드 컨텍스트로 사용됩니다. 모든 경로는 현재 디렉터리를 기준으로 합니다.
그렇지 않으면 Google Cloud 빌드팩을 선택합니다. 빌드팩 컨텍스트를 사용하여 디렉터리를 지정하고 진입점(선택사항)을 사용하여 서버를 시작할 명령어를 입력합니다. 예를 들면 Python의 경우 gunicorn -p :8080 main:app, 자바의 경우 java -jar target/myjar.jar입니다. 기본 동작을 사용하려면 비워 두세요.
GitHub - 아직 인증되지 않은 경우 인증을 클릭하고 안내를 따릅니다. 기본적으로 저장소 연결은 Cloud Build GitHub 앱을 통해 수행됩니다. 또는 Cloud Source Repositories에서 GitHub 저장소를 미러링할 수 있습니다. 이렇게 하려면 고급 옵션을 클릭하고 Cloud Source Repositories를 사용한 GitHub 저장소 미러링을 선택합니다.
자세히 알아보기
브랜치 - 트리거를 실행할 때 사용할 소스를 나타냅니다. 여기에 정규식을 입력할 수 있습니다. 일치하는 브랜치가 자동으로 확인되며 입력 아래에 표시됩니다. 정확히 브랜치 하나가 일치하면 트리거가 생성된 후 자동으로 실행됩니다.
빌드 유형
Docker를 사용하여 저장소를 빌드해야 하는 경우 Dockerfile이 포함되어 있으면 Dockerfile을 선택합니다. 소스 위치는 Dockerfile의 위치와 이름을 나타냅니다. 이 디렉터리는 Docker 빌드 컨텍스트로 사용됩니다. 모든 경로는 현재 디렉터리를 기준으로 합니다.
그렇지 않으면 Google Cloud 빌드팩을 선택합니다. 빌드팩 컨텍스트를 사용하여 디렉터리를 지정하고 진입점(선택사항)을 사용하여 서버를 시작할 명령어를 입력합니다. 예를 들면 Python의 경우 gunicorn -p :8080 main:app, 자바의 경우 java -jar target/myjar.jar입니다. 기본 동작을 사용하려면 비워 두세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-18(UTC)"],[],[],null,["# Continuous deployment from Git using Cloud Build\n\nYou can use Cloud Build to automate builds and deployments to\nKnative serving by using [Cloud Build trigger](/build/docs/running-builds/automate-builds)\nto automatically build and deploy your code whenever new commits are pushed to\na given branch of a Git repository.\n\nWhen you use a Cloud Build trigger to build containers, the\n[source repository information is displayed](/kubernetes-engine/enterprise/knative-serving/docs/managing/revisions#build-source)\nin the Google Cloud console for your service after you deploy to\nKnative serving.\n\nBefore you begin\n----------------\n\n- You either have a git repository with a `Dockerfile` or your codebase is written in one of the languages supported by [Google Cloud's buildpacks](/docs/buildpacks/overview): Go, Node.js, Python, Java or .NET Core.\n-\n\n\n Enable the Cloud Build and Cloud Source Repositories\n APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=sourcerepo.googleapis.com,cloudbuild.googleapis.com)\n\nSetting up continuous deployment from the Knative serving user interface\n------------------------------------------------------------------------\n\nThe procedure varies slightly depending on whether you are setting up\ncontinuous deployment on a new service or on an existing service. Click the\nappropriate tab to learn more. \n\n### New service\n\n1. Go to Knative serving in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n2. Click **Create service**.\n\n3. Fill the *Service Settings* with your preferences.\n\n4. Click **Next**.\n\n5. Select **Continuously deploy new revisions from a source repository**.\n\n6. Click **Set up with Cloud Build**.\n\n7. Select the provider and the repository.\n\n - *GitHub* - if you are not yet authenticated, click **Authenticate** and follow the instructions. By default, connecting a repository is done via the Cloud Build GitHub app. Alternatively, you can mirror your GitHub repository in Cloud Source Repositories. To do so, click *Advanced option* and check *Mirror GitHub repository using\n Cloud Source Repositories* [Learn more](/build/docs/automating-builds/create-github-app-triggers?#different_types_of_github-based_triggers)\n - *Bitbucket* - if you are not yet authenticated, click **Authenticate** and follow the instructions.\n - [*Cloud Source Repositories*](/source-repositories/docs)\n\n8. Click **Next**.\n\n9. Fill the options in Build Configuration step:\n\n - *Branch* - indicates what source should be used when running the trigger. You can put the [regex](https://github.com/google/re2/wiki/Syntax) here. Matched branches are automatically verified: you can see them below the input. Note that if exactly one branch is matched, the trigger will be automatically executed after the creation.\n - *Build Type*\n\n - If your repository should be built using Docker and it contains a\n Dockerfile, select **Dockerfile** . **Source location** indicates the\n location and name of the Dockerfile. This directory will be used as the\n Docker build context. All paths should be relative to the current\n directory.\n\n - Otherwise, select **Google Cloud Buildpacks** . Use\n **Buildpack context** to specify the directory and **Entrypoint**\n (optional) to provide the command to start the server. Example:\n `gunicorn -p :8080 main:app` for Python,\n `java -jar target/myjar.jar` for Java. Leave it blank to use\n [default behavior](/docs/buildpacks/service-specific-configs).\n\n10. Click **Save**.\n\n11. Verify the selected settings.\n\n12. Click **Create**.\n\n13. Note that you are redirected to the *Service Details* page, where you can\n track the progress of your Continuous Deployment set up.\n\n14. Once all steps are completed, note additional options:\n\n - Edit Continuous Deployment button.\n - Build History.\n - Source details in the [*Revision Details* section](/kubernetes-engine/enterprise/knative-serving/docs/managing/revisions#viewing_revision_details).\n\n### Existing service\n\n1. Go to Knative serving in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n2. Locate the service in the services list, and click on it.\n\n3. Click **Set up Continuous Deployment**.\n\n4. Select the provider and the repository.\n\n - *GitHub* - if you are not yet authenticated, click **Authenticate** and follow the instructions. By default, connecting a repository is done via the Cloud Build GitHub app. Alternatively, you can mirror your GitHub repository in Cloud Source Repositories. To do so, click *Advanced option* and check *Mirror GitHub repository using\n Cloud Source Repositories* [Learn more](/build/docs/automating-builds/create-github-app-triggers?#different_types_of_github-based_triggers)\n - *Bitbucket* - if you are not yet authenticated, click **Authenticate** and follow the instructions.\n - [*Cloud Source Repositories*](/source-repositories/docs)\n\n5. Click **Next**.\n\n6. Fill the options in Build Configuration step:\n\n - *Branch* - indicates what source should be used when running the trigger. You can put the [regex](https://github.com/google/re2/wiki/Syntax) here. Matched branches are automatically verified: you can see them below the input. Note that if exactly one branch is matched, the trigger will be automatically executed after the creation.\n - *Build Type*\n\n - If your repository should be built using Docker and it contains a\n Dockerfile, select **Dockerfile** . **Source location** indicates the\n location and name of the Dockerfile. This directory will be used as the\n Docker build context. All paths should be relative to the current\n directory.\n\n - Otherwise, select **Google Cloud Buildpacks** . Use\n **Buildpack context** to specify the directory and **Entrypoint**\n (optional) to provide the command to start the server. Example:\n `gunicorn -p :8080 main:app` for Python,\n `java -jar target/myjar.jar` for Java. Leave it blank to use\n [default behavior](/docs/buildpacks/service-specific-configs).\n\n7. Click **Save**.\n\n8. The page reloads and displays the progress of the\n Continuous Deployment setup.\n\n9. Once all steps are completed, note additional options:\n\n - Edit Continuous Deployment button.\n - Build History.\n - Source details in the [*Revision Details* section](/kubernetes-engine/enterprise/knative-serving/docs/managing/revisions#viewing_revision_details).\n\nSetting up continuous deployment manually\n-----------------------------------------\n\nRefer to\n[Setting up continuous deployment manually](/build/docs/deploying-builds/deploy-cloud-run)\nif you need to use a manual procedure and not the UI.\n\nAttach existing Cloud Build trigger to Knative serving service.\n---------------------------------------------------------------\n\nIf you already have an existing Cloud Build trigger, you can attach it to\nthe service and take advantage of Google Cloud console features in the Service\nDetails page: **Edit Continuous Deployment** button and **Build History** chart.\n\nTo do so, you have to add a label with \u003cvar translate=\"no\"\u003egcb-trigger-id\u003c/var\u003e as a key and\nthe unique identifier of the Cloud Build trigger as value (not the trigger\nname). See [instructions](/kubernetes-engine/enterprise/knative-serving/docs/configuring/labels#set-labels) for\nsetting up the label."]]