Skip to content

Commit 2fc1e58

Browse files
committed
Add pyenv support
1 parent f5d9a0f commit 2fc1e58

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

cli/cli.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
// App props
3333
const (
3434
APP = "init-exporter"
35-
VER = "0.18.0"
35+
VER = "0.19.0"
3636
DESC = "Utility for exporting services described by Procfile to init system"
3737
)
3838

common/init-exporter.spec

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
Summary: Utility for exporting services described by Procfile to init system
4444
Name: init-exporter
45-
Version: 0.18.0
45+
Version: 0.19.0
4646
Release: 0%{?dist}
4747
Group: Development/Tools
4848
License: MIT
@@ -52,7 +52,7 @@ Source0: %{name}-%{version}.tar.gz
5252

5353
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
5454

55-
BuildRequires: golang >= 1.9
55+
BuildRequires: golang >= 1.10
5656

5757
Provides: upstart-exporter = %{version}-%{release}
5858
Provides: systemd-exporter = %{version}-%{release}
@@ -111,6 +111,9 @@ rm -rf %{buildroot}
111111
################################################################################
112112

113113
%changelog
114+
* Thu Apr 05 2018 Anton Novojilov <[email protected]> - 0.19.0-0
115+
- Added pyenv support
116+
114117
* Wed Feb 21 2018 Anton Novojilov <[email protected]> - 0.18.0-0
115118
- Removed validation for environment variables' values
116119

export/export_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ func (s *ExportSuite) TestUpstartExport(c *C) {
215215

216216
c.Assert(serviceAHelper[4:], DeepEquals,
217217
[]string{
218-
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "",
218+
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh", "",
219219
"cd /srv/service/serviceA-dir && exec env STAGING=true /bin/echo 'serviceA:pre' &>>/srv/service/serviceA-dir/log/serviceA.log && exec env STAGING=true /bin/echo 'serviceA' &>>/srv/service/serviceA-dir/log/serviceA.log && exec env STAGING=true /bin/echo 'serviceA:post' &>>/srv/service/serviceA-dir/log/serviceA.log",
220220
""},
221221
)
222222

223223
c.Assert(serviceBHelper[4:], DeepEquals,
224224
[]string{
225-
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "",
225+
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh", "",
226226
"cd /srv/service/working-dir && exec env $(cat /srv/service/working-dir/shared/env.vars 2>/dev/null | xargs) STAGING=true /bin/echo 'serviceB'",
227227
""},
228228
)
@@ -443,14 +443,14 @@ func (s *ExportSuite) TestSystemdExport(c *C) {
443443

444444
c.Assert(serviceAHelper[4:], DeepEquals,
445445
[]string{
446-
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "",
446+
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh", "",
447447
"exec env STAGING=true /bin/echo 'serviceA:pre' &>>/srv/service/serviceA-dir/log/serviceA.log && exec env STAGING=true /bin/echo 'serviceA' &>>/srv/service/serviceA-dir/log/serviceA.log && exec env STAGING=true /bin/echo 'serviceA:post' &>>/srv/service/serviceA-dir/log/serviceA.log",
448448
""},
449449
)
450450

451451
c.Assert(serviceBHelper[4:], DeepEquals,
452452
[]string{
453-
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "",
453+
"[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh", "",
454454
"exec env $(cat /srv/service/working-dir/shared/env.vars 2>/dev/null | xargs) STAGING=true /bin/echo 'serviceB'",
455455
""},
456456
)

export/systemd.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const TEMPLATE_SYSTEMD_HELPER = `#!/bin/bash
3131
# This helper generated {{.ExportDate}} by init-exporter/systemd for {{.Application.Name}} application
3232
3333
[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh
34+
[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh
3435
3536
{{ if .Service.HasPreCmd }}{{.Service.GetCommandExec "pre"}} && {{ end }}{{.Service.GetCommandExec ""}}{{ if .Service.HasPostCmd }} && {{.Service.GetCommandExec "post"}}{{ end }}
3637
`

export/upstart.go

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const TEMPLATE_UPSTART_HELPER = `#!/bin/bash
2828
# This helper generated {{.ExportDate}} by init-exporter/upstart for {{.Application.Name}} application
2929
3030
[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh
31+
[[ -r /etc/profile.d/pyenv.sh ]] && source /etc/profile.d/pyenv.sh
3132
3233
cd {{.Service.Options.WorkingDir}} && {{ if .Service.HasPreCmd }}{{.Service.GetCommandExec "pre"}} && {{ end }}{{.Service.GetCommandExec ""}}{{ if .Service.HasPostCmd }} && {{.Service.GetCommandExec "post"}}{{ end }}
3334
`

0 commit comments

Comments
 (0)