Skip to content

Commit

Permalink
Merge pull request #22 from funbox/develop
Browse files Browse the repository at this point in the history
Version 0.12.1
  • Loading branch information
andyone authored Apr 10, 2017
2 parents 58c24e0 + 88599e0 commit 9116f07
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// App props
const (
APP = "init-exporter"
VER = "0.12.0"
VER = "0.12.1"
DESC = "Utility for exporting services described by Procfile to init system"
)

Expand Down
5 changes: 4 additions & 1 deletion common/init-exporter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

Summary: Utility for exporting services described by Procfile to init system
Name: init-exporter
Version: 0.12.0
Version: 0.12.1
Release: 0%{?dist}
Group: Development/Tools
License: MIT
Expand Down Expand Up @@ -132,6 +132,9 @@ rm -rf %{buildroot}
###############################################################################

%changelog
* Mon Apr 10 2017 Anton Novojilov <[email protected]> - 0.12.1-0
- Improved environment variables validation for support appending of variables

* Mon Apr 10 2017 Anton Novojilov <[email protected]> - 0.12.0-0
- Improved environment variables validation
- Added argument for disabling application validation
Expand Down
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
4 changes: 2 additions & 2 deletions procfile/procfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func (s *ProcfileSuite) TestProcV2Parsing(c *C) {
c.Assert(service.Options.Env, NotNil)
c.Assert(service.Options.Env["RAILS_ENV"], Equals, "staging")
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["JAVA_OPTS"], Equals, "\"${JAVA_OPTS} -Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError -Djava.net.preferIPv4Stack=true\"")
c.Assert(service.Options.Env["QUEUE"], Equals, "log_syncronizer,file_downloader,log_searcher")
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.EnvString(), Equals, "HEX_HOME=/srv/projects/ploy/shared/tmp JAVA_OPTS=\"${JAVA_OPTS} -Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError -Djava.net.preferIPv4Stack=true\" 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
45 changes: 42 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ Supported init systems: upstart and systemd
* [Procfile v.1](#procfile-v1)
* [Procfile v.2](#procfile-v2)
* [Exporting](#exporting)
* [Build Status](#build-status)
* [Command options](#command-options)
* [Build status](#build-status)
* [License](#license)

### Installation

Before the initial install allows git to use redirects for [pkg.re](https://github.com/essentialkaos/pkgre) service (_reason why you should do this described [here](https://github.com/essentialkaos/pkgre#git-support)_):

```
git config --global http.https://pkg.re.followRedirects true
```

To build the init-exporter from scratch, make sure you have a working Go 1.5+ workspace ([instructions](https://golang.org/doc/install)), then:

```bash
go get -d github.com/funbox/init-exporter
cd $GOPATH/src/github.com/funbox/init-exporter
make all
sudo make install
[sudo] make install
```

### Configuration
Expand Down Expand Up @@ -262,7 +269,39 @@ sudo init-exporter -u -f upstart myapp

The logs are not cleared in this case. Also, all old application scripts are cleared before each export.

### Build Status
### Command options

```
Usage: init-exporter {options} app-name

Options

--procfile, -p file Path to procfile
--dry-start, -d Dry start (don't export anything, just parse and test procfile)
--disable-validation, -D Disable application validation
--unistall, -u Remove scripts and helpers for a particular application
--format, -f upstart|systemd Format of generated configs
--no-colors, -nc Disable colors in output
--help, -h Show this help message
--version, -v Show version

Examples

init-exporter -p ./myprocfile -f systemd myapp
Export given procfile to systemd as myapp

init-exporter -u -f systemd myapp
Uninstall myapp from systemd

init-exporter -p ./myprocfile -f upstart myapp
Export given procfile to upstart as myapp

init-exporter -u -f upstart myapp
Uninstall myapp from upstart

```
### Build status
| Repository | Status |
|------------|--------|
Expand Down
2 changes: 1 addition & 1 deletion testdata/procfile_v2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ commands:
interval: 10
env:
RAILS_ENV: staging # if needs to be redefined or extended
JAVA_OPTS: '"-Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError"'
JAVA_OPTS: '"${JAVA_OPTS} -Xms512m -Xmx1g -XX:+HeapDumpOnIutOfMemoryError -Djava.net.preferIPv4Stack=true"'
QUEUE: log_syncronizer,file_downloader,log_searcher
HEX_HOME: /srv/projects/ploy/shared/tmp
LC_ALL: "en_US.UTF-8"
Expand Down

0 comments on commit 9116f07

Please sign in to comment.