Code Monkey home page Code Monkey logo

repowatch's Introduction

RepoWatch

Build Status

Takes Gerrit events or GitLab Web Hooks and updates the correct branch of a puppet checkout

Requirements

yum install git python-argparse PyYAML python-daemon python-paramiko

Installation/Configuration

Configuration is done with two files:

repowatch.conf:

[gerrit]
username = exampleuser
hostname = gerrit.example.com
port = 29418
key_filename = /home/exampleuser/.ssh/id_rsa

[gitlab]
username = git
hostname = gitlab.example.com
port = 22
key_filename = /home/exampleuser/.ssh/id_rsa

projects.yaml:

---
- project: test-project
  type: gerrit
  path: /tmp/test-project-2
  cmds:
    - echo "%{branch} %{branchdir}"
    - echo "%{project} %{projectdir}"
- project: testuser/test-project
  type: gitlab
  path: /tmp/test-project

User specified commands run after checkout.

Credits

Gerrit watcher code is based on https://github.com/atdt/gerrit-stream

Apache license

repowatch's People

Contributors

kincl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

repowatch's Issues

Why not trust permission from git?

snippet from update_branch() function:

        # set perms
        self.run_cmd('find {0} ' \
                     '-type f ' \
                     '-not -path *.git* ' \
                     '-exec chmod 644 {{}} ;'.format(fullpath))

        self.run_cmd('find {0} ' \
                     '-type d ' \
                     '-not -path *.git* ' \
                     '-exec chmod 755 {{}} ;'.format(fullpath))

Why do you change the permissions? Git only store the executable bit for files meaning we would ever end up with files that have '0755' or '0644'. Semi-Source

If there is a security concern about having files with the executable bit, perhaps an option should be created such as 'noexec'. If noexec is true, then we could call find to strip executable bits.

Clean git checkouts before fetches

Sometimes the branch checkout directory goes foobar and repowatch cannot handle the failure scenario. What ends up happening is a vague git fetch command failed.

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.