spuder / puppet-gitlab

A puppet module to install gitlab 7
Apache License 2.0
36 stars 44 forks source link

Use the actual file name for the package #154

Closed edestecd closed 9 years ago

edestecd commented 9 years ago

Fix the problem of newer package being named 'gitlab-ce'. This uses a regular expression to pull the actual package name out of the file name, so this will continue to work even if the package name changes yet again.

edestecd commented 9 years ago

Any thoughts on this approach to fixing the new package name in newer gitlab packages? This seems like a semi important fix, since we can't get newer versions of gitlab...

spuder commented 9 years ago

Can you walk me through these lines?

 if $omnibus_filename =~ /^([^.]+)(?:(?:-)(\d\..+))*$/ {
   $omnibus_packagename = $1

This would need some tests. Long term, there is a pull request to use the offical gitlab package repository on packagecloud. However that isn't working yet.

edestecd commented 9 years ago

@spuder that regular expression splits up the file name into parts. The first part is the package name without the version. Example: if $omnibus_filename is gitlab-ce-7.11.3~omnibus-1.x86_64.rpm then $1 will be gitlab-ce

I have used that regular expression in other projects to achieve this. It works on standard rpm and deb file name formats. They follow a standard convention for naming packages.

edestecd commented 9 years ago

@spuder I'd love an implementation that used the cloud repos, but there seems to be some issues with their puppet module not using standard yum_repo and apt puppet types/modules...

All the newer versions are only available from the new cloud repo. https://packages.gitlab.com/gitlab/gitlab-ce