I have crated Cloud Build triggers to create CI/CD pipeline for a project and its working perfectly fine. Now, I want to configure SMTP notifications so the entire project team can have updates on the status of build.
Cloud Build publishes status of build to Cloud Pub/Sub topic cloud-builds. So to achieve this I have been following this documentation published by Google Cloud.
I have done exactly what the document says -
Enabled required APIs.
Created a secret to store my SMTP credentials.
Gave permission to Compute Engine default service account to access created secret.
Wrote a notifier configuration as documented.
apiVersion: cloud-build-notifiers/v1 kind: SMTPNotifier metadata: name: master-deloyed-to-staging. spec: notification: filter: build.status == Build.Status.SUCCESS delivery: server: smtp.gmail.com port: '587' sender: [email protected] from: [email protected] recipients: - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] password: secretRef: dropoff-gmail secrets: - name: dropoff-gmail value: projects/project-id/secrets/secret-name/versions/latest
Created a bucket and uploaded the smtp-notifier.yaml to it.
Now this is the stage where I prepared a command to deploy notifier to cloud run. I using the image used in the documentation to deploy to cloud build
gcloud run deploy dropoff-deployment-notifier \ --image=us-east1-docker.pkg.dev/gcb-release/cloud-build-notifiers/smtp:latest \ --update-env-vars=CONFIG_PATH=gs://dropoff-assets/cloud_run/smtp-notifier.yaml
Which returns me an error -
ERROR: (gcloud.run.deploy) Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.
As, stated in error something is wrong with the PORT but don't know how to fix it.