Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian package files #1094

Closed
wants to merge 18 commits into from
Closed

Debian package files #1094

wants to merge 18 commits into from

Conversation

rsampaio
Copy link

Added files to create a proper .deb file as follows:

git clone repository/gitlabhq.git
cd gitlabhq
dpkg-buildpackage

To install the package and deps use:
dpkg -i ../gitlabhq_*.deb
apt-get -f install

Advantages over debian_ubuntu.sh:

  • Init and preinst scripts automatically setup the environment and git/gitlab keys.
  • No need of any -dev package to deploy in production (including gcc, cpp, python-dev...)
  • Use distro packages for gitolite
  • Nginx vhost debianized (not enabled by default, /etc/nginx/sites-available)

Thanks for the great project, much simpler and elegant than gitorious.
Rodrigo.

@riyad
Copy link
Contributor

riyad commented Jul 18, 2012

+1 nice. this should simplify deployment on debian machines quite a bit

proxy_redirect off;
# you need to change this to "https", if you set "ssl" directive to "on"
proxy_set_header X-FORWARDED_PROTO http;
proxy_set_header Host gitlab.local.host:80;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you set up the host to use https you should also change the host port to 443. Also consider adding a second server block to handle http to https redirection :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay to reply, but the commit added to my master branch should fix it, ssl and non-ssl vhost with redirect rule for nginx.

@PotHix
Copy link
Contributor

PotHix commented Jul 31, 2012

+1

@optikfluffel
Copy link
Contributor

really much want this for my nginx riding on a little squeezy debian :)

@sodabrew
Copy link
Contributor

sodabrew commented Aug 8, 2012

This wins. Thank you!

@NARKOZ
Copy link
Contributor

NARKOZ commented Aug 8, 2012

👍 but I'm not sure if it should be included in the Gitlab repo.

/cc @vsizov

@PotHix
Copy link
Contributor

PotHix commented Aug 8, 2012

@NARKOZ why not?

@huglester
Copy link

nice one! +1

Section: ruby
Priority: extra
Maintainer: root <root@squeezao>
Build-Depends: debhelper, libicu-dev, ruby1.9.1-dev, libmysqlclient-dev, libsqlite3-dev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also include bundler as a build dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK Debian doesn't have a bundler package by default.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, I'm on Debian Sid and missed that it isn't on Squeeze. I guess the situation isn't as cut-and-dry then. I don't know much about packaging practices. Is there some clean way of resolving this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add the dependency as you said and assume an installed version from bundler as a backport. I can't see a better solution.
@rsampaio, ideas?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think the best we can do to support multiple debian releases is to add a Recommend line on this control file so via apt-get it will recommend the libbundle-ruby during the install, we use a backported libbundle-ruby1.9.1 internaly here so forcing this package as a dep will work but definitively we should not force a dependency when it does not exist in that release.
Let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

case "$1" in
configure)

git_exists=$(grep -w git /etc/passwd | wc -l)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplest portable way to check that an user exists is to chown something.

Like this:

makedir /tmp/gitlab root:root 700
chgrp git /tmp/gitlab 2>/dev/null ||
  addgroup --system gitl
chown git /tmp/gitlab 2>/dev/null ||
  adduser --system --home /home/git --shell /bin/sh --gecos 'git version control'  --ingroup git --disabled-password git

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, changed my previous try to this one.

@rsampaio
Copy link
Author

Thanks for the comments @Gittex, tried to fix everything so should be ok now.

@NARKOZ
Copy link
Contributor

NARKOZ commented Sep 15, 2012

@PotHix it's for gitlab source, not for binary or installation packages.

@rsampaio can you submit it to gitlabhq/gitlab-recipes? It has more chances to be merged there. Thanks.

@rsampaio
Copy link
Author

@NARKOZ well ok I can do it, will help who would like to deploy via a proper package but I strong believe that it should be part of the source like any other distribute-able software including the ones that gitlab rely on. Also it is just the "debian" directory and nothing else was touched.
Thanks anyway.

@NARKOZ
Copy link
Contributor

NARKOZ commented Sep 15, 2012

Since we officially support deb-based distros I'll better ping @randx :)

nothing else was touched

You added CAS authentication. That's why Travis build fails.

@rsampaio
Copy link
Author

@NARKOZ ops that was a mistake, this was merged from locaweb/gitlabhq and CAS is only meant to be used internally and not part of this pull request, gonna fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet