GithubHelp home page GithubHelp logo

iconoeugen / docker-gitolite Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 5.0 12 KB

Docker image for gitolite server that supports git push/fetch and gitweb on same HTTP URL

License: MIT License

Shell 100.00%
openshift git kubernetes docker gitolite gitweb docker-image docker-container docker-gitolite docker-compose

docker-gitolite's Introduction

iconoeugen/docker-gitolite

A docker image to run Gitolite

Gitolite website: gitolite.com GitWeb website: git-scm.com

Quick start

Clone this project:

git clone https://github.com/iconoeugen/docker-gitolite
cd docker-gitolite

Make your own GitWeb image

Build your image:

docker build -t dockergitolite_gitolite .

Run your image:

docker run --name dockergitolite_test -p 8080:80 --detach dockergitolite_gitolite

Check running container:

git ls-remote http://localhost:8080/git/testing.git

Stop running container:

docker stop dockergitolite_test

Remove stopped container:

docker rm dockergitolite_test

Docker compose

Compose is a tool for defining and running multi-container Docker applications, using a Compose file to configure the application services.

Build docker images:

docker-compose build

Create and start docker containers with compose:

docker-compose up -d

Stop docker containers

docker-compose stop

Removed stopped containers:

docker-compose rm

Environment Variables

  • ADMIN_USER: Admin user name. Defaults to admin.
  • ADMIN_PASS: Admin user password. Defaults to password.

Set your own environment variables

Environment variables can be set by adding the --env argument in the command line, for example:

docker run --env ADMIN_USER="administrator" --env ADMIN_PASS="changeme" --name dockergitolite_test -p 8080:80 --detach dockergitolite_gitolite

To clone the default testing repository from the container started before, use the command:

git clone http://localhost:8080/git/testing.git

Note: you may include the ".git" at the end but it is optional.

OpenShift

OpenShift Origin is a distribution of Kubernetes optimized for continuous application development and multi-tenant deployment.

More information:

The OpenShift Gitolite application template is available in openshift

Upload template to OpenShift

Create a new template application in OpenShift (before continue, make sure you are logged in and a new project is created in OpenShift)

oc create -f openshift/gitolite.json

Create application from template

oc new-app gitolite -p ADMIN_USER=admin -p ADMIN_PASS=changeme

Tests

Access the GitWeb UI at: http://localhost:8080/git

Push content to the new empty repository:

mkdir testing
cd testing
git init
touch README
git add README
git commit -m "First commit"
git remote add test http://admin:password@localhost:8080/git/testing.git
git push test master

Logging

The installation will write logging files in two different locations depending one the application that generates the log events:

  • httpd: redirected to docker output
  • gitolite: /var/lib/gitolite3/.gitolite/logs/gitolite-<year>-<month>.log

Managing gitolite

The complete documentation about gitolite can be found here

Update configuration

The configuration for gitolite is stored in a git repository named gitolite-admin. All changes that are done to this configuration is automatically applied after a git push using a post-commit hook. To clone the git repository run the command:

git clone http://admin:[email protected]:8080/git/gitolite-admin

Make gitolite-admin readable by git-daemon until a first commit to ensure you can access gitolite-admin.git repo after first commit (POST_COMMIT trigger) give read access to 'daemon' user (see http://gitolite.com/gitolite/gitweb-daemon.html):

repo gitolite-admin
    RW+     =   admin
    R       =   daemon

Add rule to allow to create "wild" repositories

Add at the beginning of conf/gitolite.conf to following configuration to allow all users that have valid credentials to create a new repository:

repo pub/..*
    C       =   @all
    RW+     =   CREATOR
    RW      =   WRITERS
    R       =   READERS

When trying to clone a respository that doesn't exists yeat, the configuration above will create a new one and configure as CREATOR the user that made the request:

git clone http://admin:[email protected]:8080/git/pub/myrepo

The new repository can be cloned only after the permissions for read have been granted to some user/group:

curl http://admin:[email protected]:8080/git/perms?pub/myrepo+%2B+WRITERS+@all

See more info here

Gitolite shell commands

Gitolite is providing features that are accessible as shell commands. The command name will come just after the /git/, followed by a ?, followed by the arguments, with + representing a space.

The get a list of all enabled features, call:

curl http://admin:[email protected]:8080/git/help

To get information about a specific command, call:

curl http://admin:[email protected]:8080/git/info?-h

See more info here

docker-gitolite's People

Contributors

iconoeugen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.