On Thu, Sep 17, 2015 at 11:13:10PM +0200, Alan McKinnon wrote:
> On 17/09/2015 22:53, Alec Ten Harmsel wrote:
> > Unfortunately, the right way with nodejs/ruby web stuff is to use the
> > tooling specific to the language. If this[1] is what you're trying to
> > deploy, I feel sorry.
> 
> Yes, that's the one

Yay, perl, perl6, and JS. All at the same time.

> > 
> > If I was serious about deploying this, I would:
> > 
> > 1. Fork the repo and add a remote on my own server
> > 2. Add your custom configuration
> > 3. Write a small shell script that
> >   1. Runs `git pull` from your own infrastructure
> >   2. Installs perl/node deps locally
> >   3. Runs the gulp build
> >   4. Runs plackup
> > 4. Add an init script that runs that start script
> 
> I followed that mostly except for forking the repo and writing a small
> shell script - I much prefer proper ebuilds to hacky scripts. Even
> though I'm a Linux sysadmin I hate ad-hoc shell scripts with a passion

I am the same way; I do not like shell scripts. Anything longer than 15
lines or so is written in Ruby, other than my firewall setup script.

I'm not proud of myself for suggesting what I did; just trying to
minimize your pain. Another option could be something along the lines
of:

1. ebuild installs files to `/var/musicbrainz` or wherever
2. Add a small shell script to `/var/musicbrainz` or wherever that:
  1. Installs perl/node deps locally
  2. Runs the gulp build
  3. Runs plackup
3. Add an init script that runs that start script

I guess, since you're not developing musicbrainz thingy, that the git
repo was a bit of overkill.

> > This sucks, but it seems to be the way a lot of web stuff is deployed
> > these days.

All these dynamic languages suffer from the fun problem that developers
that don't write enough tests have essentially no guarantee that their
code actually parses. I can't count how many times I've run Ruby,
Python, or Bash scripts only to have 'variable not found' or type
errors; all of the things that compilers do really well[1].

One of the things that results from this (IMO) is that they bundle
deps/enforce strict versions on stuff because they have to just to run
stuff. For example, a while ago www-apps/jekyll was broken because a gem
it depended on happened to be a newer version and changed the API enough
that jekyll broke. To be fair to the Gentoo developers, jekyll is
~amd64, so I didn't really care.

Alec

[1] For example, below are two *valid* files; one Python, one Ruby. Both
would obviously fail to compile if it was transposed to C/C++/Java, for
good reason.

#!/usr/bin/env ruby
if false
  puts hey
else
  puts 'hey'
end


#!/usr/bin/env python
if False:
    print(hey)
else:
    print('hey')

Reply via email to