1 |
On Thu, Sep 17, 2015 at 11:13:10PM +0200, Alan McKinnon wrote: |
2 |
> On 17/09/2015 22:53, Alec Ten Harmsel wrote: |
3 |
> > Unfortunately, the right way with nodejs/ruby web stuff is to use the |
4 |
> > tooling specific to the language. If this[1] is what you're trying to |
5 |
> > deploy, I feel sorry. |
6 |
> |
7 |
> Yes, that's the one |
8 |
|
9 |
Yay, perl, perl6, and JS. All at the same time. |
10 |
|
11 |
> > |
12 |
> > If I was serious about deploying this, I would: |
13 |
> > |
14 |
> > 1. Fork the repo and add a remote on my own server |
15 |
> > 2. Add your custom configuration |
16 |
> > 3. Write a small shell script that |
17 |
> > 1. Runs `git pull` from your own infrastructure |
18 |
> > 2. Installs perl/node deps locally |
19 |
> > 3. Runs the gulp build |
20 |
> > 4. Runs plackup |
21 |
> > 4. Add an init script that runs that start script |
22 |
> |
23 |
> I followed that mostly except for forking the repo and writing a small |
24 |
> shell script - I much prefer proper ebuilds to hacky scripts. Even |
25 |
> though I'm a Linux sysadmin I hate ad-hoc shell scripts with a passion |
26 |
|
27 |
I am the same way; I do not like shell scripts. Anything longer than 15 |
28 |
lines or so is written in Ruby, other than my firewall setup script. |
29 |
|
30 |
I'm not proud of myself for suggesting what I did; just trying to |
31 |
minimize your pain. Another option could be something along the lines |
32 |
of: |
33 |
|
34 |
1. ebuild installs files to `/var/musicbrainz` or wherever |
35 |
2. Add a small shell script to `/var/musicbrainz` or wherever that: |
36 |
1. Installs perl/node deps locally |
37 |
2. Runs the gulp build |
38 |
3. Runs plackup |
39 |
3. Add an init script that runs that start script |
40 |
|
41 |
I guess, since you're not developing musicbrainz thingy, that the git |
42 |
repo was a bit of overkill. |
43 |
|
44 |
> > This sucks, but it seems to be the way a lot of web stuff is deployed |
45 |
> > these days. |
46 |
|
47 |
All these dynamic languages suffer from the fun problem that developers |
48 |
that don't write enough tests have essentially no guarantee that their |
49 |
code actually parses. I can't count how many times I've run Ruby, |
50 |
Python, or Bash scripts only to have 'variable not found' or type |
51 |
errors; all of the things that compilers do really well[1]. |
52 |
|
53 |
One of the things that results from this (IMO) is that they bundle |
54 |
deps/enforce strict versions on stuff because they have to just to run |
55 |
stuff. For example, a while ago www-apps/jekyll was broken because a gem |
56 |
it depended on happened to be a newer version and changed the API enough |
57 |
that jekyll broke. To be fair to the Gentoo developers, jekyll is |
58 |
~amd64, so I didn't really care. |
59 |
|
60 |
Alec |
61 |
|
62 |
[1] For example, below are two *valid* files; one Python, one Ruby. Both |
63 |
would obviously fail to compile if it was transposed to C/C++/Java, for |
64 |
good reason. |
65 |
|
66 |
#!/usr/bin/env ruby |
67 |
if false |
68 |
puts hey |
69 |
else |
70 |
puts 'hey' |
71 |
end |
72 |
|
73 |
|
74 |
#!/usr/bin/env python |
75 |
if False: |
76 |
print(hey) |
77 |
else: |
78 |
print('hey') |