nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.
http://pypi.python.org/pypi/honcho
MIT License
1.59k stars 145 forks source link

Export: Append \n to EOF is not already present #116

Closed msabramo closed 9 years ago

msabramo commented 9 years ago

Alternative solution to https://github.com/nickstenning/honcho/pull/107

nickstenning commented 9 years ago

I'd rather we just got the whitespace correct :). See #117.

msabramo commented 9 years ago

I think we still could use this -- note that % signs at the end of each file below:

[marca@marca-mac2 export_test]$ git log -n 1
commit d8be8f4a846b998fb2287429b254327a8d180b0c
Author: Nick Stenning <nick@whiteink.com>
Date:   Sat Nov 29 16:04:41 2014 +0100

    export: Improve design and test coverage of export

    This commit:

    - Moves responsibility for I/O back into `honcho.command` rather than
      `honcho.export`.
    - Changes exporters so that `#export()` takes a list of
      `honcho.environ.ProcessParams` objects and optional template context.
      This means that concurrency, process naming, and port assignment is
      now much more likely to be consistent between `honcho start` and
      `honcho export`.
    - Improves test coverage of the `honcho.export` package.
    - Removes a couple more fragile export integration tests.

[marca@marca-mac2 export_test]$ honcho export upstart out

[marca@marca-mac2 export_test]$ cat out/export_test-ansvc-1.conf
start on starting export_test-ansvc
stop on stopping export_test-ansvc
respawn

exec su - export_test -s /bin/sh -c 'cd /Users/marca/dev/git-repos/honcho/export_test;export PORT=5000;bin/ansvc start >> /var/log/export_test/ansvc-1.log 2>&1'%

[marca@marca-mac2 export_test]$ cat out/export_test-ansvc.conf
start on starting export_test
stop on stopping export_test%

[marca@marca-mac2 export_test]$ cat out/export_test.conf
pre-start script

bash << "EOF"
  mkdir -p /var/log/export_test
  chown -R export_test /var/log/export_test
EOF

end script

start on (started network-interface
          or started network-manager
          or started networking)

stop on (stopping network-interface
         or stopping network-manager
         or stopping networking)%
msabramo commented 9 years ago

Though this will conflict with #119, so maybe I should send you a PR for that branch...