-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds EL7 support with systemd, removes --refresh parameter that is no…
… longer used in devpi-server, updates travis configuration with matrix / deploy on tags, more thorough readme with examples
- Loading branch information
Showing
17 changed files
with
228 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.9.3-p547 | ||
2.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
class devpi::service { | ||
class devpi::service inherits ::devpi::params { | ||
|
||
$provider = $::devpi::params::systemd ? { | ||
true => 'systemd', | ||
default => 'upstart' | ||
} | ||
|
||
service { $::devpi::service_name: | ||
ensure => $::devpi::service_ensure, | ||
enable => $::devpi::service_enable, | ||
provider => 'upstart' | ||
provider => $provder | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class devpi::systemd { | ||
exec { 'devpi_systemctl_daemon_reload': | ||
command => 'systemctl daemon-reload', | ||
path => '/bin:/usr/bin:/sbin:/usr/sbin', | ||
refreshonly => true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,72 @@ | ||
require 'spec_helper' | ||
describe 'devpi' do | ||
|
||
context 'with defaults for all parameters' do | ||
it { should compile.with_all_deps } | ||
it { should_not contain_package('devpi-client') } | ||
it { should contain_package('devpi-server') } | ||
it { should contain_service('devpi-server') } | ||
it { should contain_user('devpi') } | ||
it { should contain_file('/opt/devpi') } | ||
it { should contain_file('/etc/init/devpi-server.conf').with_content(/exec su - devpi -c "devpi-server --host 0.0.0.0 --port 3141 --refresh 3600 --serverdir \/opt\/devpi"\n/) } | ||
end | ||
[6,7].each do |osmaj| | ||
context "on RedHat#{osmaj}" do | ||
let(:facts) do | ||
{ | ||
:operatingsystemmajrelease => osmaj | ||
} | ||
end | ||
|
||
context "with defaults for all parameters" do | ||
|
||
it { should compile.with_all_deps } | ||
it { should_not contain_package('devpi-client') } | ||
it { should contain_package('devpi-server') } | ||
it { should contain_service('devpi-server') } | ||
it { should contain_user('devpi') } | ||
it { should contain_file('/opt/devpi') } | ||
if osmaj == 6 then | ||
it { | ||
should contain_file('/etc/init/devpi-server.conf') | ||
.with_content(/exec su - devpi -c "devpi-server --host 0.0.0.0 --port 3141 --serverdir \/opt\/devpi"\n/) | ||
} | ||
it { | ||
should_not contain_class('devpi::config').that_notifies('Class[devpi::systemd]') | ||
} | ||
elsif osmaj == 7 then | ||
it { | ||
should contain_file('/usr/lib/systemd/system/devpi-server.service') | ||
.with_content(/User=devpi\nGroup=devpi\nExecStart=\/usr\/bin\/devpi-server --host 0.0.0.0 --port 3141 --serverdir \/opt\/devpi\n/) | ||
} | ||
it { | ||
should contain_class('devpi::config').that_notifies('Class[devpi::systemd]') | ||
} | ||
end | ||
end | ||
|
||
context 'with client => true' do | ||
let :params do { | ||
:client => true | ||
} end | ||
|
||
context 'with client => true' do | ||
let :params do { | ||
:client => true | ||
} end | ||
it { should compile.with_all_deps } | ||
it { should contain_package('devpi-client') } | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
it { should contain_package('devpi-client') } | ||
context 'with virtualenv => /venv' do | ||
let :params do { | ||
:virtualenv => '/venv' | ||
} end | ||
|
||
it { should compile.with_all_deps } | ||
it { should_not contain_class('devpi::package') } | ||
if osmaj == 6 then | ||
it { | ||
should contain_file('/etc/init/devpi-server.conf') | ||
.with_content(/exec su - devpi -c "\/venv\/bin\/devpi-server --host 0.0.0.0 --port 3141 --serverdir \/opt\/devpi"\n/) | ||
} | ||
elsif osmaj == 7 then | ||
it { | ||
should contain_file('/usr/lib/systemd/system/devpi-server.service') | ||
.with_content(/User=devpi\nGroup=devpi\nExecStart=\/venv\/bin\/devpi-server --host 0.0.0.0 --port 3141 --serverdir \/opt\/devpi\n/) | ||
} | ||
end | ||
end | ||
|
||
end | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=devpi | ||
Wants=basic.target | ||
After=basic.target network.target | ||
|
||
[Service] | ||
User=<%= @user %> | ||
Group=<%= @group %> | ||
ExecStart=<%= @devpi_path %> --host <%= @listen_host %> --port <%= @listen_port %> --serverdir <%= @server_dir %> | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Oops, something went wrong.