Open Closed

How can I use ABP Suite from command line? #841


User avatar
0
alper created
Support Team Director

I have a requirement to use Suite from command line for my CI/CD pipeline


1 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    ABP Suite doesn't have command line interface, basically you use it from its local website. But as it's a local website running in your computer, it is also possible to use it via command line with HTTP requests.

    Capture the HTTP request from your browser and save it as PowerShell or cURL command or any other command type. Then use it via command line...

    In the screenshot you can see how I add a new solution from the website and how I get the Id of the solution from the response. (All the metadata of the solution comes with the reponse)

    I can copy this request as Powershell script:

    This is the Powershell script:

    Invoke-WebRequest -Uri "http://localhost:20000/api/abpSuite/addSolution" `
    -Method "POST" `
    -Headers @{
    "Accept"="application/json, text/javascript, */*; q=0.01"
      "X-Requested-With"="XMLHttpRequest"
      "User-Agent"="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
      "Origin"="http://localhost:20000"
      "Sec-Fetch-Site"="same-origin"
      "Sec-Fetch-Mode"="cors"
      "Sec-Fetch-Dest"="empty"
      "Referer"="http://localhost:20000/?solutionId=fb88d059-305a-4960-a888-50a7fe822e18&solution=Mvc.EfCoreTier01153035"
      "Accept-Encoding"="gzip, deflate, br"
      "Accept-Language"="en-US,en;q=0.9,tr-TR;q=0.8,tr;q=0.7"
      "Cookie"="cookieconsent_status=dismiss; .AspNetCore.Antiforgery.aU7BqYCchuM=CfDJ8CGbzqjAwCVHiX1EJkoJOY28ASegiwslrUiaPPgq3PzOOM_NTNwDfpkBfg5z9PfS_ffRh9l5QR-86TysvdERAGuaMOJ9LHtnYEYKiEKWZ404NAHi43-jAWyi0GiOiM3BkLHjBXGYTiLP-DWO2rZFjtA; ActiveSolution=Mvc.EfCoreTier01153035%24fb88d059-305a-4960-a888-50a7fe822e18"
    } `
    -ContentType "application/json" `
    -Body "{`"path`":`"C:\\MyProjects\\4\\4.2.0-preview\\Mvc.EfCoreNonTierPublic01212715`"}"
    

    And I can run this Powershell command to add my solution from command line

    With the same steps you can do anything that Suite does, from command line...

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38