Skip to content

CLI command to remove an app #12

Closed

Description

@pareeohnos

Is your feature request related to a problem? Please describe.
Apologies if this is already something that's possible, but I'm assessing solutions to a CI pipeline I'm trying to setup which involves deploying a pull request for testing and CapRover looks perfect for what we want to do. I couldn't find a way however of removing an app from the CLI?

I'd like a way of dynamically adding/removing apps from the CLI so it can be automated by the CI. This would allow me to have a new app deployed when a pull request is opened (which seems possible already), but more specifically to be able to remove that app when the PR is merged/closed. The documentation doesn't make any mentione of removing apps.

If this is already possible then great but I haven't seen anything

Activity

  1. githubsaturn commented on Mar 11, 2019

    @githubsaturn
    Collaborator

    CLI doesn't have support for this. The reason is that CapRover has a relatively large API, not all API methods are implemented in CLI. It'll be a maintenance nightmare to have a CLI command for each API endpoint. We kept the CLI commands limited to most common ones.

    Having said that, since CapRover has an open rest API, it is completely possible to brew your custom bash script using CURL. Having said that, I think we can implement a super generic CLI command to take endpoint path, params and etc, to remove dependency on CURL. Something like:

    caprover apiCall --inputPath ./pathToJson
    

    where pathToJson is a file containing:

    {
        "host" : "captain.root.domain.com",
        "password" : "123123123",
        "endPoint" : {
            "path": "/api/v2/apps/register"
            "method" : "GET"
            "data": { "appName":"my-awesome-app"}
        }
    }
    

    This way we cover "all" endpoints and there is no dependency on CURL, and no maintenance nightmare.

  2. added
    enhancement
    on Mar 11, 2019
  3. pareeohnos commented on Mar 11, 2019

    @pareeohnos
    Author

    That would be perfect! Completely understand not implementing every function in the CLI, that would be a nightmare. Is there anything documented around the API that's currently available? I didn't see anything but may have overlooked it. I'd be happy to help on this if we end up using caprover as our solution though I can't give an ETA on when that might be - it's sadly not a top priority :(

  4. githubsaturn commented on Mar 11, 2019

    @githubsaturn
    Collaborator

    No "official" documentation of endpoints ATM. But there is some sort of a pseudo documentation in the frontend code. It's pretty easy to understand:
    https://github.com/caprover/caprover-frontend/blob/master/src/api/ApiManager.ts

  5. pareeohnos commented on Mar 12, 2019

    @pareeohnos
    Author

    Ah great thanks, I'll take a look :)

  6. githubsaturn commented on Aug 16, 2019

    @githubsaturn
    Collaborator

    Thanks to @Hazzard17h

    The generic API is now implemented! Give it a shot!

  7. pareeohnos commented on Aug 19, 2019

    @pareeohnos
    Author

    ah amazing, thanks for the update :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions