Coder Social home page Coder Social logo

docker-r10k's Introduction

R10k GitLab

Puppet deployments with GitLab's webhooks and R10k

Usage

Set the following environment variables:

Variable Description
WEBHOOK_SECRET The secret specified when creating the webhook in GitLab
GIT_REMOTE Path to your git repository
GIT_DEPLOY_KEY SSH private key for deployment

You will also need to point your loadbalancer to or forward port 8080.

Example 1 (with deploy key variable)

$ docker run -p 8080:8080 \
             -e WEBHOOK_SECRET=topsecret \
             -e [email protected]:erlend/docker-r10k.git \
             -e GIT_DEPLOY_KEY="`cat ~/.ssh/id_rsa`" \
             -v puppet-environments:/etc/puppetlabs/code/environments \
             erlend/r10k

Example 2 (with deploy key as file)

$ docker run -p 8080:8080 \
             -e WEBHOOK_SECRET=topsecret \
             -e [email protected]:erlend/docker-r10k.git \
             -v ~/.ssh/id_rsa:/home/r10k/.ssh/id_rsa:ro \
             -v puppet-environments:/etc/puppetlabs/code/environments \
             erlend/r10k

Custom r10k configurations

To use a customized r10k configuration, mount it to the default location. GIT_REMOTE becomes unnecessary at that point.

$ docker run -p 8080:8080 \
             -e WEBHOOK_SECRET=topsecret \
             -v ~/.ssh/id_rsa:/home/r10k/.ssh/id_rsa:ro \
             -v /etc/puppetlabs/r10k/r10k.yaml:/etc/puppetlabs/r10k/r10k.yaml:ro \
             -v puppet-environments:/etc/puppetlabs/code/environments:rw \
             erlend/r10k

docker-r10k's People

Contributors

erlend avatar

Watchers

 avatar  avatar

docker-r10k's Issues

entrypoint.d scripts do not work

entrypoint.sh runs run-parts --exit-on-error entrypoint.d, but the first script in entrypoint.d (perm) always exits with an error, so the other 2 scripts never run.

The entrypoint.d/perm script fails because it tries to do a chown on a directory that also is a docker volume (/etc/puppetlabs/code/environments) and this fails (even if the owner is already r10k). Please consider appending a || true to this line in this script.

Note: setting the owner of this directory to a "random" uid (outside this docker container the user r10k may or may not exist, and it does not need to have the same uid as in this container) may cause issues. The user 'puppet' in a different container also needs access to files in this volume...

VOLUME command in Dockerfile creating extra volumes

The comment in the VOLUME command of the Dockerfile is not supported, and instead it reads all of those words as volumes to be created. As such, when run, docker creates a #, r10k, cache, puppet, and environments volume - in addition to the expected.

Merges

This seems to work great for pushes, but when it comes to merges it's not updating the production branch. Instead, I get this message that it couldn't find any ref. Makes some sense, because gitlab doesn't send that for a merge request. Any ideas?

error: cannot lock ref 'refs/heads/production': ref refs/heads/production is at b664475ef19f09971d467e8ad5128adbee836269 but expected ce1172d03028dab09682e4781513fe8ff7879713
 ! ce1172d..b664475  production -> production  (unable to update local ref)

Please also support IPv6

By default unicorn listens on only IPv4 (0.0.0.0:8080). Please make it bind to ::8080, so that both IPv4 and IPv6 should work.

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.