Discuss continuous delivery of infrastructure
wish we had a github backup for when they have issues. if we had something that synchronized all of our org, we could have our remotes all point to that which would redirect to github, but if github was having issues, it would point to its own cache until the issues get resolved.
does anything like that exist?
gitlab running on-premise?
Anyone done any work with feature branch based test environments? Seems easy enough to create them based on branch/pr but trying to find a convincing method to shut down those envs when the pr is closed / branch is merged.
Using drone for my ci platform but it doesn’t seem to be tracking the right events for this - not sure many do?
Am i on the right track or is there a better logic for wrapping these up? :/
We do this with preview environments on kubernetes with helm & helmfile
a) spin up environment when
deploy label added (one of the triggers); destroy when removed
b) spin up environment when PR
synchronized; destroy when
GitHub actions supports all of these trigger events
our pipelines for codefresh are here https://github.com/cloudposse/example-app/tree/master/codefresh
Example application for CI/CD demonstrations of Codefresh - cloudposse/example-app
I’ve done this a couple ways:
cron job that compares git branches to test envs, and shuts down any test envs for branches that have been deleted. This does, of course, rely on branches being deleted after they’re merged. I know both github and gitlab now have an option you can set that will auto delete a branch after it is merged to master (or whatever you designate the “main” branch)
Gitlab CI has the concept of environments that are tied to branches. When a branch is deleted gitlab will run any jobs you’ve configured to run at the shutdown of an environment.
I’ve not used drone, but I’d be surprised if it doesn’t have something like events or webhooks that you could use for this.