Sitecore Demo Portal Configured GitHub Url format

Note: At the time of this writing, the Sitecore Demo Portal is available only for Sitecore partners and MVPs. Also, the portal is meant to deploy only pre-built demo sites! This blog post is an attempt to add more documentation as to how to deploy configured repositories!

Personally speaking, I feel excited about this move by Sitecore especially the Portal team. It is always good to have something pre-deployed to build Proof of Concepts quickly. This is a welcome move that cuts down on installation/setup issues and allows to concentrate just on the development curve.

In this blog post, I try to push my configured fork from Sitecore Demo Portal to Vercel. Based on my understanding and my earlier blog post, this is how a project deployment should occur from the Sitecore Demo Portal to Vercel:




Note that the above diagram is figuratively meant to show that the demo portal deploys the GitHub code to Vercel project!

With that basic understanding, after I created a Vercel token as per my earlier blog, I configured the portal to use my fork url and performed a deploy from the Sitecore Demo Portal to see an error :(

Based on the input from the Sitecore demo team, I realised that the GitHub url should be keyed-in without the .git extension (as highlighted in the watermark text):


In other words, the portal likes https://github.com/navancommits/Sitecore.Demo.Edge 

but not 

https://github.com/navancommits/Sitecore.Demo.Edge.git

In future this might be fixed but until then you can use this blog post as reference.

The actual Vercel Error (thrown when you add the repo/fork url with .git):

System.Exception: Error creating a Vercel project:  {"error":{"code":"bad_request","message":"To link a GitHub repository, you need to install the GitHub integration first. Make sure there aren't any typos and that you have access to the repository if it's private.","action":"Install GitHub App","link":"https://github.com/apps/vercel","repo":"Sitecore.Demo.Edge.git"}}

 ---> Flurl.Http.FlurlHttpException: Call failed with status code 400 (Bad Request): POST https://api.vercel.com/v8/projects

   at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)

   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)

   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)

   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)

   at Sitecore.Demo.Portal.Service.Services.VercelService.CreateProject(String team, String token, String projectName, String rootDirectory, String repo, List`1 env) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Service\Services\VercelService.cs:line 50

   --- End of inner exception stack trace ---

   at Sitecore.Demo.Portal.Service.Services.VercelService.CreateProject(String team, String token, String projectName, String rootDirectory, String repo, List`1 env) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Service\Services\VercelService.cs:line 68

   at Sitecore.Demo.Portal.Jobs.VercelProject.CreateVercelProjects.Run(TimerInfo myTimer, ILogger log) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Jobs\VercelProject\CreateVercelProjects.cs:line 99


Maximum 3 Vercel projects Error:



System.Exception: Error creating a Vercel project:  {"error":{"code":"repo_links_exceeded_limit","message":"A Git Repository cannot be connected to more than 3 Projects.","action":"Learn More","link":"https://vercel.link/repository-connection-limit","repo":"navancommits/Sitecore.Demo.Edge"}}

 ---> Flurl.Http.FlurlHttpException: Call failed with status code 400 (Bad Request): POST https://api.vercel.com/v8/projects

   at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)

   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)

   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)

   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)

   at Sitecore.Demo.Portal.Service.Services.VercelService.CreateProject(String team, String token, String projectName, String rootDirectory, String repo, List`1 env) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Service\Services\VercelService.cs:line 50

   --- End of inner exception stack trace ---

   at Sitecore.Demo.Portal.Service.Services.VercelService.CreateProject(String team, String token, String projectName, String rootDirectory, String repo, List`1 env) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Service\Services\VercelService.cs:line 68

   at Sitecore.Demo.Portal.Jobs.VercelProject.CreateVercelProjects.Run(TimerInfo myTimer, ILogger log) in D:\a\1\s\instance-manager\src\Web\Portal\Sitecore.Demo.Portal.Jobs\VercelProject\CreateVercelProjects.cs:line 99


How to delete a Vercel Project:

DELETE https://api.vercel.com/v8/projects/sitecore-demo-edge



Note that the id must match as-is in the Vercel project

Reference: https://vercel.com/docs/rest-api

Comments

Popular Posts