Git Product home page Git Product logo

ranch2git's Introduction

Ranch2Git

Docker Repository on Quay Codeship Docker Automated buil Docker Pulls Docker Stars

Introduction

Ranch2Git keeps track of your Rancher stacks. It is supposed to be deployed as a Dockerimage. As such, it can be easily deployed with Rancher, making it really easy to use.

Getting started

Installation

Automated builds of the image are available on Dockerhub and is the recommended method of installation.

docker pull gmentsik/ranch2git

Alternatively you can build the image yourself.

docker build -t ranch2git github.com/gmentsik/ranch2git

Quickstart

The recommended way of running ranch2git is to deploy it directly as service in Rancher.

  1. Create a new Git-Repository on your host. This can be any Git-Repo on any host. Please note that currently only HTTP(S) is supported, since the main target is Github and GitLab

  2. Make sure you have access to your repo with a username + password combination. (HTTP Simple Auth)

  3. Add a new Account API Key in Rancher Rancher Web UI -> API -> Add Account API Key

  4. You can copy&paste this docker-compose file in a new rancher-stack.

  5. Replace the RANCHER_API_USER and RANCHER_API_PASS environmental variables with the generated User and Password.

version: '2'
services:
  ranch2github:
    image: gmentsik/ranch2git:latest
    environment:
      RANCHER_APIV2_URL: http://rancher-url.com/v2-beta
      RANCHER_API_USER: api-user
      RANCHER_API_PASS: api-user-password
      GIT_REPO_URL: https://github.com/username/repo.git
      GIT_REPO_USER: username
      GIT_REPO_PASS: password
      UPDATE_EVERY: 5m
    stdin_open: true
    network_mode: host
    tty: true
    labels:
      io.rancher.container.pull_image: always

*OR you can use the v1 API for older rancher versions

version: '2'
services:
  ranch2github:
    image: gmentsik/ranch2git
    environment:
      GIT_REPO_URL: https://github.com/username/repo.git
      GIT_REPO_USER: git-user
      GIT_REPO_PASS: git-password
      UPDATE_EVERY: 1h
    labels:
      io.rancher.container.create_agent: "true"
      io.rancher.container.agent.role: "environment"
    stdin_open: true
    network_mode: host
    tty: true

Alternatively, you can use the sample docker-compose.yml file to start the container using Docker Compose

Environment Variables

Variable Default Value Description Examples
RANCHER_APIV2_URL "" The full URL to your Rancher API V2 http://rancher.company1.com/v2-beta
RANCHER_API_USER "" The generated rancher API User 2CE23B40FA3761K91C66
RANCHER_API_PASS "" The generated password of your rancher API User A2nO8r43jAMrXMQeJd5VpFvEYHKzYgKPSuuTt7ct
GIT_REPO_URL "" Full http URL to your Git-Repository https://github.com/company1/rancher-conf.git
GIT_REPO_USER "" Your Git-Username company1
GIT_REPO_PASS "" Your Git Password soVeryStrongPasswordCannotBeHacked
UPDATE_EVERY "5m" The Frequency of the script execution. 1m, 10s, 2h

Labels (Rancher API V1)

You can use the v1 API by adding two labels to your service

  io.rancher.container.create_agent=true
  io.rancher.container.agent.role=environment

This will provide the three environment variables required to access the rancher api.

Shell Access

For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0 or higher you can access a running containers shell by starting bash using docker exec:

docker exec -it ranch2git bash

everything happens inside the /root folder.

Contributing

If you find this image useful here's how you can help:

  • Send a pull request with your awesome features and bug fixes, to the dev branch.
  • Help users resolve their issues.

Issues

Before reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker installation guide for instructions.

SELinux users should try disabling SELinux using the command setenforce 0 to see if it resolves the issue.

If the above recommendations do not help then report your issue along with the following information:

  • Output of the docker version and docker info commands
  • The docker run command or docker-compose.yml used to start the image. Mask out the sensitive bits.
  • Please state if you are using Boot2Docker, VirtualBox, etc.

ranch2git's People

Contributors

n1v0k avatar henrypfhu avatar

Stargazers

 avatar Jonas Kello avatar Alexey Kachalov avatar Ash Williams avatar  avatar  avatar Arne avatar

Watchers

 avatar  avatar  avatar

ranch2git's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.