Deploy error from Travis. Source repository URL is invalid does not match the expected pattern
Closed this issue · 1 comments
HarvsG commented
So my .travis.yml build usually deploys happily. But after returning to the project after a few months I am finding that I am getting the below error. Looks at the gcloud docs seems to suggest other formats for source repository builds, but I have tried these and have gotten the same error. Please help!
I can manually trigger the build using the UI!
Restarting command:
$ gcloud --quiet beta functions deploy SpaceXFulfillment --source-url https://source.developers.google.com/p/r-spacex-ai/r/r-SpaceX-AI-google-source-repo --source-path / --trigger-http
WARNING: The --source-url flag is deprecated; use --source instead.
WARNING: The --source-path flag is deprecated; use --source instead.
ERROR: (gcloud.beta.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[The request has errors
Problems:
Source repository URL is invalid https://source.developers.google.com/p/r-spacex-ai/r/r-SpaceX-AI-google-source-repo/moveable-aliases/master// does not match the expected pattern
I have tried with several other formats!!
Environment details
- OS: Ubuntu 14.04.5 LTS
- Node.js version: 6.9.1
- npm version: 3.10.8
- @google-cloud/functions-emulator version:
Google Cloud SDK 180.0.0
bq 2.0.27
core 2017.11.10
gsutil 4.28
Steps to reproduce
- https://travis-ci.org/HarvsG/r-SpaceX-AI-Bot/builds/304024024
- I had the same problem on the CLI Emulator
- interestingly if I manually fill in the repository box with the URL instead of just the repo name on the GUI build interface I get the same error. (It works if I just put the repo name).
Thanks!
HarvsG commented
Fixed by using the new command format as found here, although those docs are very confusing as I did not understand regex. So I did the below changes. I have noticed it is /moveable-aliases/
for branches and /fixed-aliases/
for tag. So I made the below change to my .travis.yml file.
- - gcloud --quiet beta functions deploy SpaceXFulfillment --source-url https://source.developers.google.com/p/r-spacex-ai/r/r-SpaceX-AI-google-source-repo --source-path / --source-branch master --trigger-http
+ - gcloud --quiet beta functions deploy SpaceXFulfillment --source https://source.developers.google.com/projects/r-spacex-ai/repos/r-SpaceX-AI-google-source-repo/moveable-aliases/master --trigger-http