125 Commits
Author SHA1 Message Date
David Dollar 04d56efae5 fix runnability of commands v0.13.1 2014-09-18 12:44:54 -04:00
David Dollar ec1d07333c allow update command to be disabled v0.13.0 2014-09-18 12:40:56 -04:00
David Dollar 57dca4ca12 make Version a variable so it can be set from a build flag 2014-09-18 12:31:01 -04:00
David Dollar 23a87cdb1a Merge pull request #35 from godep-migrator/master
godep: switch to -copy=true
v0.12.0
2014-09-11 12:43:44 +02:00
Keith Rarick 653d7a69d1 godep: include dependency source code
Flag -copy=false in godep will be removed. This commit
switches to using 'godep save' with no flag. We don't
change the version of any dependencies here, just rerun
godep to include source code.

See also the proposal for removing flag -copy at
http://goo.gl/RpYs8e.
2014-09-10 19:04:14 -07:00
David Dollar 90b3a377b0 allow default concurrency v0.11.0 2014-08-12 18:37:34 -04:00
David Dollar 73521422be better error message for concurrency 2014-06-19 18:57:55 -04:00
David Dollar ac64b63ecd Merge pull request #29 from pwaller/protect-start
Check ps.Start() error
2014-06-19 18:55:05 -04:00
Peter Waller fff52bfbba Check ps.Start() error
This doesn't usually happen unless the shell is broken or unavailable.

It's nice though to have a program which shows an error message rather
than quitting silently. The test to see if this is working is to modify
the shell in `unix.go` to something which doesn't exist.
2014-06-02 19:35:13 +01:00
David Dollar 26261f844e Merge pull request #26 from pwaller/fix-len
Fix LongestProcessName
v0.10.0
2014-06-02 11:14:43 -07:00
David Dollar 4039b934de Merge pull request #27 from pwaller/process-refactor
Big process refactor
2014-06-02 11:14:26 -07:00
Peter Waller 37aac8a97e Refactor to use Barrier 2014-05-22 17:42:48 +01:00
Peter Waller 08178d82bd Fix windows build 2014-05-22 07:56:00 +01:00
Peter Waller 2c17c9a489 Add writey fixture program 2014-05-21 22:01:27 +01:00
Peter Waller 8b69d28b66 Eliminate unused functions and type Outlet 2014-05-21 20:53:09 +01:00
Peter Waller 34b39bf589 Fix #16 and race condition on final lines printed
This commit refactors to read whole lines from Stdin/Stdout pipes and
fixes a race condition where the final output of a process may be
missed.
2014-05-21 20:26:56 +01:00
Peter Waller 5636c013d8 Merge branch 'write-refactor' into process-refactor 2014-05-21 19:52:41 +01:00
Peter Waller 78d368d8ae Add error handling to Signal() 2014-05-21 19:49:13 +01:00
Peter Waller 1b47f05224 Eliminate Pid() function 2014-05-21 19:49:13 +01:00
Peter Waller 16953497ba Eliminate unused imports from windows.go 2014-05-21 19:49:13 +01:00
Peter Waller c165325ed1 Embed *exec.Cmd in Process struct
Motivation: Trying to slim the Process wrapper as much as possible to
make later transformations easier.
2014-05-21 19:49:12 +01:00
Peter Waller a899cb4fed Don't set p.Root in NewProcess
It's being eliminated by embedding the *Cmd in the Process.
2014-05-21 19:10:17 +01:00
Peter Waller 537f1d6e40 Make Process.Start the same across platforms 2014-05-21 19:07:05 +01:00
Peter Waller 9fa9adb06d Factor out PlatformSpecificInit() 2014-05-21 19:05:24 +01:00
Peter Waller 708f015f26 Refactor ShellInvocationCommand
This is done because I want to make the *exec.Command shim narrower so
that we can transition to another method for reading Stdout/Stderr to
fix the newline bug described in #16.
2014-05-21 17:59:02 +01:00
Peter Waller 9b422de60d Eliminate p.Running and cross-platform
Now that the process which starts things is responsible for killing
them, it's no longer possible for the *Process to be nil, so the check
is unnecessary and there is no platform difference, so it's moved to
process.go.
2014-05-21 17:26:30 +01:00
Peter Waller 6f180b7482 Move envAsArray from Process onto Env 2014-05-21 17:22:23 +01:00
Peter Waller f2170857e6 Move 'shutting down' msg to before close(teardown) 2014-05-21 09:41:37 +01:00
Peter Waller 1bc3decf0c Implement teardownNow with Kill on 2nd CTRL-C 2014-05-21 09:35:15 +01:00
Peter Waller a5074c5c37 Refactor process shutdown
This is a large change which makes startProcess() responsible for
shutting its own process down, rather than having a global map.

This makes it much easier to reason about who owns what and get the
synchronization right.

The main immediate bugfix is that now we only attempt to send SIGKILL to
processes which haven't yet shut down, making it clearer which processes
are responsible for a delayed shutdown.

It introduces a `teardown` channel which is closed to signal to all
process-monitoring goroutines that they should clean up.

In addition, the platform-specific code has been thinned. Some of the
platform logic moved into the process-monitoring code because it needed
to for now after the introduction of the <-finished barrier.
2014-05-21 09:28:41 +01:00
Peter Waller ca11ca6388 Refactor ShutdownProcess to smaller platform-specific part 2014-05-21 08:44:06 +01:00
Peter Waller 9c2bf670ca Refactor interrupt monitoring and shutdown
This makes it so that the same goroutine responsible for starting
processes shuts them down. This is a stepping stone to a larger refactor
whose goal is to eliminate race conditions.
2014-05-21 08:37:21 +01:00
Peter Waller c3001f4941 Use defer to unlock mutex
This is safer in general, in case a function exits for any reason,
including due to a panic (which may be recovered later).
2014-05-21 08:02:40 +01:00
Peter Waller eb103b5843 Use defer to mark goroutine completed
Also, move the wg.Add() next to the point where it matters.
2014-05-21 08:00:38 +01:00
Peter Waller 9fd558a9cc Simplify procName calculation 2014-05-21 07:59:38 +01:00
Peter Waller 826329f426 Move mutex onto OutletFactory
It's bad form for the mutex to live in the global namespace when it
doesn't need to.
2014-05-21 07:54:07 +01:00
Peter Waller 4c61bb7cb7 Refactor colored writing into WriteLine() function
This serves two purposes. It protects with a Mutex where it was missing
before, and makes it so that there is only one place to change code for
the line writing, which will be a later pull request.
2014-05-21 07:51:22 +01:00
Peter Waller 7d87c01493 Fix LongestProcessName 2014-05-21 07:36:21 +01:00
David Dollar 306759d426 Merge pull request #25 from jwilder/jw-restart
Add restart option
v0.9.0
2014-05-12 19:16:22 -04:00
Jason Wilder 42b0dcaf43 Add restart option
If a child process dies, forego shuts down all processes.  The -r
option will restart the failed child process.
2014-05-12 17:14:47 -06:00
David Dollar 3b4357efc5 Merge pull request #15 from jweslley/build_constraints
use build constraints
2014-05-10 10:07:59 -04:00
David Dollar d18b15d882 Merge pull request #21 from kirs/godeps-makefile
Use godeps to compile Forego
2014-05-10 10:07:23 -04:00
David Dollar 283fa30801 Merge pull request #24 from jwilder/jw-concurrency
Add concurrency support
2014-05-10 10:06:57 -04:00
Jason Wilder b2c557a162 Remove concurrency flag from run command
Not currently supported.
2014-05-07 15:01:45 -06:00
Jason Wilder 16b7228a81 Add concurrency support
For #18
2014-05-07 15:01:39 -06:00
David Dollar 1c8276df1e Merge pull request #22 from davidpelaez/master
Fix bug calculating a group's port
v0.8.3
2014-04-29 07:49:33 -04:00
David Pelaez 495a0557d1 Fix bug calculating a group's port
In the original foreman, an increase of 100 defined the number of the first process of the next group, hence, a two type Procfile uses ports 5000 and 5100. Forego was correctly printing this expected numbers but line 86 was recalculating this port number again with a distance of 1000 not a hundred. The result was that I was seeing my second type of process listening on port 6000, not the expected 5100.
2014-04-28 21:43:01 -05:00
Kir Shatrov e2d64fe468 Use godeps to compile Forego 2014-03-27 12:41:03 +04:00
Jonhnny Weslley b36d1c8980 use build constraints 2013-12-09 00:05:01 -03:00
David Dollar 6e983fe41c remove optional version from update v0.8.2 2013-09-22 16:19:30 -04:00