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's for cleanup - useful, uncertain what to do #145

Open
justin808 opened this issue Mar 20, 2024 · 0 comments
Open

CLI's for cleanup - useful, uncertain what to do #145

justin808 opened this issue Mar 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@justin808
Copy link
Member

justin808 commented Mar 20, 2024

See code here: https://github.com/shakacode/hichee/blob/master/lib/tasks/cpl.rake (private repo for ShakaCode).

We should abstract out this code and ever to the controlplane.yml file for values.

In the below code, cpl:cleanup_review_apps could potentially be configured by the controlplane.yml file and be a new CLI:

cpl cleanup_apps -a <app prefix>

This is what we have in CI.

Database cleanups would be app specific.

  nightly-cleanup-review-apps-and-staging-org:
    <<: *cpln-defaults
    steps:
      - checkout
      - run: *install-control-plane-tools
      - run:
          name: Setup Control Plane tools
          command: |
            cpln profile create default --token $CPLN_TOKEN_STAGING --org $CPLN_ORG_STAGING
      - run:
          name: Cleanup stale review apps based on open PRs
          command: |
            cpl run:detached -a $APP_NAME_STAGING --image latest --use-local-token -- LOG_LEVEL=warn GH_TOKEN=$GH_TOKEN rails \
              cpl:setup_cpln \
              cpl:cleanup_review_apps \
              cpl:cleanup_review_app_databases

We need some hook, like the release script to:

  1. create resources for a review app
  2. cleanup resources for a review app

and we could configure those hooks in controlplane.yml.

@justin808 justin808 changed the title CLI's for cleanup CLI's for cleanup - useful, uncertain what to do May 14, 2024
@justin808 justin808 added the enhancement New feature or request label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants