If you are getting errors during the Cloud Build phase, then you can either add the environment variables during the Build phase (e.g., using /cloudbuild.yaml) or you can change your application such that it does not try to initialize during the build phase.