-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from rchapman83:dev
added buildfile and updated components.
- Loading branch information
Showing
3 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
# Build from GCP CloudBuild samples - github.com/GoogleCloudPlatform/cloud-build-samples/tree/main/python-example-flask | ||
# [START cloudbuild_python_yaml] | ||
# [START cloudbuild_python_dependencies_yaml] | ||
steps: | ||
# Install dependencies | ||
- name: python | ||
entrypoint: pip | ||
args: ["install", "-r", "requirements.txt", "--user"] | ||
# [END cloudbuild_python_dependencies_yaml] | ||
|
||
# [START cloudbuild_python_tests_yaml] | ||
# Run unit tests | ||
- name: python | ||
entrypoint: python | ||
args: ["-m", "pytest", "--junitxml=${SHORT_SHA}_test_log.xml"] | ||
# [END cloudbuild_python_tests_yaml] | ||
|
||
# [START cloudbuild_python_image_yaml] | ||
# Docker Build | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: ['build', '-t', | ||
# 'us-central1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}', '.'] | ||
'australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}', '.'] | ||
# [END cloudbuild_python_image_yaml] | ||
|
||
# [START cloudbuild_python_push_yaml] | ||
# Docker push to Google Artifact Registry | ||
- name: 'gcr.io/cloud-builders/docker' | ||
# args: ['push', 'us-central1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}'] | ||
args: ['push', 'australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}'] | ||
# [END cloudbuild_python_push_yaml] | ||
|
||
# [START cloudbuild_python_deploy_yaml] | ||
# Deploy to Cloud Run | ||
- name: google/cloud-sdk | ||
# args: ['gcloud', 'run', 'deploy', 'helloworld-${SHORT_SHA}', | ||
# '--image=us-central1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}', | ||
# '--region', 'us-central1', '--platform', 'managed', | ||
# '--allow-unauthenticated'] | ||
args: ['gcloud', 'run', 'deploy', 'personalweb-${SHORT_SHA}', | ||
'--image=australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA}', | ||
'--region', 'australia-southeast1', '--platform', 'managed', | ||
'--allow-unauthenticated'] | ||
# [END cloudbuild_python_deploy_yaml] | ||
|
||
# [START cloudbuild_python_logs_yaml] | ||
# Save test logs to Google Cloud Storage | ||
artifacts: | ||
objects: | ||
location: gs://${_BUCKET_NAME}/ | ||
paths: | ||
- ${SHORT_SHA}_test_log.xml | ||
# [END cloudbuild_python_logs_yaml] | ||
# Store images in Google Artifact Registry | ||
images: | ||
# - us-central1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA} | ||
- australia-southeast1-docker.pkg.dev/${PROJECT_ID}/${_ARTIFACT_REGISTRY_REPO}/myimage:${SHORT_SHA} | ||
# [END cloudbuild_python_yaml] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
gunicorn==22.0.0 | ||
flask==2.3.2 | ||
google-cloud-datastore==1.10.0 | ||
google-cloud-logging==1.14.0 | ||
flask==3.1.1 | ||
pytest==8.3.3 | ||
google-cloud-datastore==2.20.1 | ||
google-cloud-logging==3.11.3 | ||
setproctitle |