#gitops (2020-04)

Discuss continuous delivery of infrastructure

Archive: https://archive.sweetops.com/gitops/

2020-04-01

2020-04-23

RB avatar

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?

Zachary Loeber avatar
Zachary Loeber

gitlab running on-premise?

2020-04-25

jedineeper avatar
jedineeper

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? :/

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We do this with preview environments on kubernetes with helm & helmfile

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

2 strategies:

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

a) spin up environment when deploy label added (one of the triggers); destroy when removed

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

b) spin up environment when PR openened, reopened, or synchronized; destroy when merged or closed

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

GitHub actions supports all of these trigger events

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

so does #codefresh

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
cloudposse/example-app

Example application for CI/CD demonstrations of Codefresh - cloudposse/example-app

2020-04-27

bradym avatar

I’ve done this a couple ways:

  1. 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)

  2. 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.

1
    keyboard_arrow_up