vbehar / openshift-git

Import/Export OpenShift resources from/to a Git repository
Apache License 2.0
8 stars 3 forks source link

OpenShift/Git Integration

Import/Export OpenShift resources from/to a Git repository.

DockerHub Travis Circle CI

openshift-git is an OpenShift client that can be used to export resources from your cluster to a Git repository, or to import resources from a Git repository to your cluster. It is written in Go so it just produces a single binary.

Goal

The main goal of this project is to store your OpenShift resources (buildconfigs, deploymentconfigs, ...) in a Git repository, so that you can record every change, and thus have an easy access to an older version, thanks to Git history.

While it can't really be used as an audit tool (it won't store who did the change, or why they did it), it will still record what has been changed and when, which is quite useful.

It can be used to export either a single namespace (so that if you are not a cluster-admin, you can still benefit from it), or the whole cluster (obviously only if you are a cluster-admin).

Features

Usage

Get the binary from the latest release, then just run

openshift-git

and it will print the available commands, options, and some examples.

How It Works

The export command has 2 modes:

By default it will only commit to the local Git repository, but if you provide the URL of a remote Git repository, it will periodically push the local commits to the remote repository.

It can export as little or as many different types of resources as you need, depending on how you start it.

Running on OpenShift

There are 2 ways to deploy this application on an OpenShift cluster:

Running locally

If you want to run it on your laptop:

License

Copyright 2016 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.