Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI command to remove an app #12

Closed
pareeohnos opened this issue Mar 11, 2019 · 6 comments
Closed

CLI command to remove an app #12

pareeohnos opened this issue Mar 11, 2019 · 6 comments
Labels
enhancement Something could be done better

Comments

@pareeohnos
Copy link

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

@githubsaturn githubsaturn transferred this issue from caprover/caprover Mar 11, 2019
@githubsaturn
Copy link
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.

@githubsaturn githubsaturn added the enhancement Something could be done better label Mar 11, 2019
@pareeohnos
Copy link
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 :(

@githubsaturn
Copy link
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

@pareeohnos
Copy link
Author

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

@githubsaturn
Copy link
Collaborator

Thanks to @Hazzard17h

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

@pareeohnos
Copy link
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
Labels
enhancement Something could be done better
Projects
None yet
Development

No branches or pull requests

2 participants