Exchange ruby ​​code within the organization

My team and I are starting to create some reusable scripts. They can only be used in our organization if they work with proprietary applications and our specific server environment. Therefore not suitable for rubyforge or github etc.

My question is: what is the best practice to ensure that we use the latest and greatest scripts for all users? We pretty much run these scripts on one server, but maybe you need to extend them to others.

Should we merge them into gem and run a private gem server?

Or something simpler like a regular, public lib directory. Perhaps using a script to download / update from our SCM?

Other ideas?

Thanks....

+4
source share
3 answers

It depends on some factors, such as the number of people who want to change the code (only your team, or someone else), or how much money do you have for this?

Personally, I would create a build + gem server where you can download scripts using some version control system (for example, git or svn, depending on how many people are working on the project), and then create a cron task that automatically generate gems from sources at common intervals and save them as different versions. Thus, you can be sure that you always have an authorization server that stores your applications, and you can always get an earlier version if something breaks. Your script can create separate gem version names, such as "appserv-edge" or "appserv-stable"

You can also check github's private source options if you have the money to afford it. However, I do not know if they have buildings for creating and placing stones for open source programs.

+2
source

I created a private gemserver and it is dead easily. The only tricky bit is to decide how you want your users to download gems. Personally, I just use the PHP upload form and check it to make sure it doesn't mask existing stones.

+1
source

In my office, we use a hybrid approach for some of our common scripts and libraries. We collect all of them into a gem, but instead of using the gem server, we store them in the original control, and then create a stone (using newgem) and install it locally as needed.

The disadvantage of this approach is that installing a gem requires two teams instead of one, but this is greatly mitigated in qa and production environments since we use Capistrano for deployment.

The deepening is that it is dead simply, and there is a very short editing / assembly / deployment cycle in development if you are working with something that requires changes in the gem. I am currently collecting many common features for a common gem, so I really appreciate this aspect.

+1
source

Source: https://habr.com/ru/post/1286274/


All Articles