Move linux support to use a custom apt repo #80

Closed
djcp opened this Issue Apr 5, 2013 · 10 comments

Projects

None yet

5 participants

@djcp
Contributor
djcp commented Apr 5, 2013

This would make the setup process for debian-derivative linux support stupid easy:

  1. Add the apt repo, accept the signing key.
  2. "aptitude install thoughtbot-rails-environment" (or whatever) which'd be a meta-package that depends on everything we install,
  3. run "thoughtbot-rails-setup" post-install to do the user-level scripted setup - install rbenv, set up zsh, etc.

The apt repo could live on heroku, no prob.

One drawback - what the setup script actually does will be less transparent, and this may be a problem if we assume that copy-and-pasteablilty for the laptop script is important.

@mike-burns
Member

Yup, this would be awesome. We could just name the package rails-environment or rails-complete or something; might as well be definitive about it.

@djcp
Contributor
djcp commented Apr 7, 2013

@mike-burns @kerrick I've started a separate repo https://github.com/djcp/rails-environment/ with some tooling to build the .deb file - I still need to build out the apt repository and figure out some provisioning questions (where it'll live, gpg key, stupid sysadmin-y stuff).

If you want to test, you can build the package manually via:

git co https://github.com/djcp/rails-environment.git
cd rails-environment
./scripts/make_ruby-environment-deb.sh

Installing it manually works, but dpkg doesn't resolve dependencies so you'll get errors. These can be fixed via "apt-get -f install". So installing it to wheezy, precise or quantal (for now) is:

sudo dpkg -i /path/to/deb/rails-environment.deb
sudo apt-get -f install

These will go away when we've got a real apt repo running. I put all the user-level stuff into a script you run manually after installing rails-environment.

@djcp djcp was assigned Apr 9, 2013
@Kerrick
Contributor
Kerrick commented Apr 9, 2013

Won't this make it more difficult to keep the Mac and Linux versions in sync? As-is, two scripts share the echo statements, comments, and general structure. The only differences are individual lines like successfully brew install redis vs successfully sudo aptitude install -y redis-server. That makes diffing the files to check that they have feature parity easy, compared to an apt repo.

@djcp
Contributor
djcp commented Apr 9, 2013

osx and debian are different OS's, we don't have to build to each other's
weaknesses. I look at this way: the goals of the laptop script can be
fulfilled in the best manner for each OS but that doesn't mean in the same
fashion.

I believe the benefits of moving to an apt repository outweigh keeping
diff'ing easier. I see them as:

  • It's easier to create distro-specific post-install scripts and
    dependencies (they are exactly the same now, but that probably won't be
    true in the future),
  • It's easier to update dependencies,
  • We might want to distribute pre-compiled binaries,
  • We'll be able to leverage the features of the debian packaging system
    more completely.

As an aside, I've been developing a nefarious plan to expand the debian
"alternatives" system to manage multiple rubies / patchlevels - the
infrastructure is already there, we'd just need to compile more binary ruby
packages. I'm still not entirely sold on this because it's really handy
to manage rubies at the userspace level. However, the benefit of using the
alternatives system is what we build would be useful to devops and it'd fit
into the debian system better.

--DJCP

On Mon, Apr 8, 2013 at 11:43 PM, Kerrick Long notifications@github.comwrote:

Won't this make it more difficult to keep the Mac and Linux versions in
sync? As-is, two scripts share the echo statements, comments, and general
structure. The only differences are individual lines like successfully
brew install redis vs successfully sudo aptitude install -y redis-server.
That makes diffing the files to check that they have feature parity easy,
compared to an apt repo.


Reply to this email directly or view it on GitHubhttps://github.com/thoughtbot/laptop/issues/80#issuecomment-16092589
.

@croaky
Member
croaky commented Jul 20, 2014

How's this idea going, @djcp?

@gohanlon
Contributor

If Linux and OS X Laptop were separated, the OS X version could be written in Ruby rather than Bash, since Ruby is included in a clean OS X install. I'm envious of Homebrew's install script, which is written in Ruby. It's easy to see how Laptop's install script could be improved by following Homebrew's example, copying ideas and even some code.

Assuming Laptop-Linux and Laptop-OSX parity is important, a shared test suite could be used to verify parity between Linux and OS X, in addition to validating Laptop builds in general. The test suite would probably be written in Bash.

@croaky
Member
croaky commented Jul 30, 2014

If Linux and OS X Laptop were separated, the OS X version could be written in Ruby rather than Bash, since Ruby is included in a clean OS X install

I love Ruby but I haven't been considering a move to Ruby for Laptop. I think I'm happy with Bash as the language for what Laptop is.

@djcp
Contributor
djcp commented Jul 31, 2014

I spiked on this idea and got relatively far. I have pretty much abandoned this now, because::

  1. debian packaging is arcane and not as up-to-date for important stuff (ruby, rails) as we want.
  2. I feel like what we have is OK on the linux side - most everything comes from default repos and the important things to install in $HOME are installed in home - ruby, node, etc.
  3. I like that the two versions are pretty close to each other, and I'd say most folks that work on laptop seem to be equally able to fix stuff on both sides,
  4. If we wanted to support additional distros, I think it'd be easier to do so with laptop now than with a debian-specific version.

Aside: there is already an automated test suite that relies on vagrant and is written in (surprise) - rspec. We originally wrote it in bash but rspec was much easier.

@croaky
Member
croaky commented Jul 31, 2014

Sounds good. Should we close this issue?

On Thu, Jul 31, 2014 at 12:52 PM, Daniel Collis-Puro <
notifications@github.com> wrote:

I spiked on this idea and got relatively far. I have pretty much abandoned
this now, because::

  1. debian packaging is arcane and not as up-to-date for important stuff
    (ruby, rails) as we want.
  2. I feel like what we have is OK on the linux side - most everything
    comes from default repos and the important things to install in $HOME are
    installed in home - ruby, node, etc.
  3. I like that the two versions are pretty close to each other, and I'd
    say most folks that work on laptop seem to be equally able to fix stuff on
    both sides,
  4. If we wanted to support additional distros, I think it'd be easier to
    do so with laptop now than with a debian-specific version.

Aside: there is already an automated test suite that relies on vagrant and
is written in (surprise) - rspec. We originally wrote it in bash but rspec
was much easier.


Reply to this email directly or view it on GitHub
#80 (comment).

@djcp
Contributor
djcp commented Aug 8, 2014

For now, I think that's the best option.

@djcp djcp closed this Aug 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment