Git Product home page Git Product logo

reaktor's People

Contributors

antaflos avatar christianhirsch avatar jeffquaintance avatar pzim avatar timhughes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reaktor's Issues

support gitlab

Gitlab is used anywhere there is a lock down environment. It would be nice to have gitlab support built in. There are a few ruby gems that integrate with the gitlab web api already, so this should be somewhat trial.

Unable to start

root@puppet:~/reaktor# rake start
rake aborted!
LoadError: cannot load such file -- resque-retry
/root/reaktor/lib/reaktor/jobs/event.rb:2:in <top (required)>' /root/reaktor/lib/reaktor/event_jobs.rb:3:in module:EventJobs'
/root/reaktor/lib/reaktor/event_jobs.rb:2:in <module:Reaktor>' /root/reaktor/lib/reaktor/event_jobs.rb:1:in <top (required)>'
/root/reaktor/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

If you dont have a :ref for a module in the Puppetfile then you get an empty Puppetfile

As per issue #7 reaktor requires a :ref for a module in the Puppetfile.

gsub!(pattern, replacement) will return nil if it doesn't find a substitution. see http://ruby-doc.org/core-2.1.4/String.html#method-i-gsub-21

Therefore, if you don't match regex correctly the value for new_contents becomes nil and that is passed as contents to write_new_puppetfile(contents) and you end up with an empty Puppetfile.

https://github.com/pzim/reaktor/blob/master/lib/reaktor/r10k/puppetfile.rb

    # update the module ref in Puppetfile
    #
    # @param module_name - The module to change the ref for
    # @param branchname - The ref to change for the module
    def update_module_ref(module_name, branchname)
      pfile = loadFile
      regex = /(#{module_name}(\.git)+['"],)+(\s*):ref\s*=>\s*['"](\w+|\w+\.\d+\.\d+)['"]/m
      new_contents = pfile.gsub!(regex, """\\1\\3:ref => '#{branchname}'""".strip)
    end

There needs to be some defensive code in here to exit the process if the new_contents is nil after new_contents = pfile.gsub!(regex, """\\1\\3:ref => '#{branchname}'""".strip)

I think something along the lines of:

    # update the module ref in Puppetfile
    #
    # @param module_name - The module to change the ref for
    # @param branchname - The ref to change for the module
    def update_module_ref(module_name, branchname)
      pfile = loadFile
      regex = /(#{module_name}(\.git)+['"],)+(\s*):ref\s*=>\s*['"](\w+|\w+\.\d+\.\d+)['"]/m
      new_contents = pfile.gsub!(regex, """\\1\\3:ref => '#{branchname}'""".strip)
      if new_contents
        contents = new_contents
      else
        logger.info("In #{self} could not find module :ref for #{module_name} on #{branchname}")
        exit # I dont know if there needs to be any clean up code here or if `exit` is the correct method
      end
      contents
    end

Crashes on each webhook

Hey - thank you for making this!

For some reason, when I post from Gitlab I get a crazy amount of stuff in the console, probably a thousand lines of stack trace. The most important pieces are:

/var/lib/gems/2.3.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:34: [BUG] Segmentation fault at 0x00000000000000
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
-- Other runtime information -----------------------------------------------

* Loaded script: resque-1.25.2: Waiting for resque_modify

* Loaded features:

You may have encountered a bug in the Ruby interpreter or extension libraries.

Any idea what might be going on here?

whats the purpose of gitaction/action_controller.rb?

i'm trying to cleanup/enhance the code a little bit and it's unclear to me if the ActionController in gitaction/action_controller.rb is ever used... i grepped the source in didn't find any use of it.

so i my current understanding is that it could be removed but i'm not 100% sure... feedback welcome

thanks
toni

"rake start" fails silently

root@puppet:~/reaktor# rake start
rake aborted!
LoadError: cannot load such file -- resque-retry
/root/reaktor/lib/reaktor/jobs/event.rb:2:in `<top (required)>'
/root/reaktor/lib/reaktor/event_jobs.rb:3:in `<module:EventJobs>'
/root/reaktor/lib/reaktor/event_jobs.rb:2:in `<module:Reaktor>'
/root/reaktor/lib/reaktor/event_jobs.rb:1:in `<top (required)>'
/root/reaktor/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
root@puppet:~/reaktor# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

Create reaktor gem

Create an installable gem so that users do not need to clone the repo. This will ease the ability to create a puppet module to maintain reaktor itself, plus make manual upgrades a little smoother.

Add documentation for how the post-receive hook works

Need to detail how the code operates on the Puppetfile (dynamic branch creation and file manipulation). Also need to add details around the 3 possible events recognized (create, update, delete) and what happens in each scenario.

issue with rake start

running rake start gives the following error
Errno::ENOENT: No such file or directory - /data/apps/sinatra/reaktor/reaktor.log

os details -

Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

RACK_ENV should be documented.

At first glance RACK_ENV is not documented. Maybe it should take current working directory if it's possible (instead of /data/apps/sinatra/reaktor).

Add support for hipchat server

I've been poking around a little, and I haven't quite figured out how to point the hipchat integrations at an internally hosted hipchat beta. All the API stuff is the same, just need to be able to modify the base url.

Puppetfile::update_module_ref assumes that a :ref already exist in Puppetfile

At first glance it's not mandatory to supply a :ref for a module in the R10K Puppetfile.

For now reaktor seems to work well only if a :ref has been specified.

It's not a big issue and the workaround is simple since we only have to add a :ref to all module in the R10K Puppetfile and the regex will work as expected.

Switch away from Thin to Puma

Puma is a much more modern Ruby webserver which doesn't require EventMachine to operate, leaving the door open to Reaktor on JRuby.

Is there any objection to me switching thin out for puma?

Problem with "get_module_name" function ?

Hi,
When I have tried "modify event", the log error is ERROR - VERIFY YOU PUPPETFILE SYNTAX - Repository: apache - Git url: git@r10k-master-dev:puppet/puppetfile.git and reaktor seems to lauch r10k deploy module true instead of r10k deploy module apache.

Here is my test Puppetfile

mod "puppetlabs/motd"

mod "apache",

:git => "git@r10k-master-dev:puppet/apache.git",

:ref => 'production'

mod "puppet-ssh",

:git => "https://github.com/saz/puppet-ssh.git",

:ref => 'master'

Is there a problem with my Puppetfile syntax or with the function get_module_name in puppetfile.rb ? (regex = /mod "'["'],\s_$\n^(\s_):git\s_=>\s_["'].*#{repo_name}.git',$/)

It seems the regexp not match with my Puppetfile.

Regards,

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.