Skip to content

Commit

Permalink
Improved env vars checks
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Apr 10, 2017
1 parent 0c68f8e commit d129cf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion procfile/procfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
REGEXP_V1_LINE = `^([A-z\d_]+):\s*(.+)`
REGEXP_V2_VERSION = `(?m)^\s*version:\s*2\s*$`
REGEXP_PATH_CHECK = `\A[A-Za-z0-9_\-./]+\z`
REGEXP_VALUE_CHECK = `\A[A-Za-z0-9_\-,+/:" ]+\z`
REGEXP_VALUE_CHECK = `\A[A-Za-z0-9_\-.,+/:;" ]+\z`
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
3 changes: 2 additions & 1 deletion procfile/procfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func (s *ProcfileSuite) TestProcV2Parsing(c *C) {
c.Assert(service.Options.Env["TEST"], Equals, "true")
c.Assert(service.Options.Env["JAVA_OPTS"], Equals, "\"-Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError\"")
c.Assert(service.Options.Env["QUEUE"], Equals, "log_syncronizer,file_downloader,log_searcher")
c.Assert(service.Options.EnvString(), Equals, "HEX_HOME=/srv/projects/ploy/shared/tmp JAVA_OPTS=\"-Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError\" QUEUE=log_syncronizer,file_downloader,log_searcher RAILS_ENV=staging TEST=true")
c.Assert(service.Options.Env["LC_ALL"], Equals, "en_US.UTF-8")
c.Assert(service.Options.EnvString(), Equals, "HEX_HOME=/srv/projects/ploy/shared/tmp JAVA_OPTS=\"-Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError\" LC_ALL=en_US.UTF-8 QUEUE=log_syncronizer,file_downloader,log_searcher RAILS_ENV=staging TEST=true")
c.Assert(service.Options.LimitFile, Equals, 4096)
c.Assert(service.Options.LimitProc, Equals, 4096)
c.Assert(service.Application, NotNil)
Expand Down
1 change: 1 addition & 0 deletions testdata/procfile_v2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ commands:
JAVA_OPTS: '"-Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError"'
QUEUE: log_syncronizer,file_downloader,log_searcher
HEX_HOME: /srv/projects/ploy/shared/tmp
LC_ALL: "en_US.UTF-8"
working_directory: '/var/...' # if needs to be redefined

my_another_tail_cmd:
Expand Down

0 comments on commit d129cf4

Please sign in to comment.