-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from tPl0ch/exec_user
Allow setting exec user for project and exec
- Loading branch information
Showing
5 changed files
with
18 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ spec/fixtures/modules/* | |
.bundle/ | ||
vendor/ | ||
Gemfile.lock | ||
pkg/ |
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 |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
# [*php_package*] | ||
# The Package name of the PHP CLI package. | ||
# | ||
# [*user*] | ||
# The user name to exec the composer commands as. Default is undefined. | ||
# | ||
# === Authors | ||
# | ||
# Thomas Ploch <[email protected]> | ||
|
@@ -43,14 +46,16 @@ | |
$repository_url = undef, | ||
$keep_vcs = false, | ||
$tries = 3, | ||
$timeout = 1200 | ||
$timeout = 1200, | ||
$user = undef, | ||
) { | ||
require git | ||
require composer | ||
|
||
Exec { | ||
path => "/bin:/usr/bin/:/sbin:/usr/sbin:${composer::target_dir}", | ||
environment => "COMPOSER_HOME=${composer::composer_home}", | ||
user => $user, | ||
} | ||
|
||
$exec_name = "composer_create_project_${title}" | ||
|
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
it { should include_class('composer') } | ||
|
||
it { | ||
should contain_exec('composer_create_project_myproject').with({ | ||
should contain_exec('composer_create_project_myproject').without_user.with({ | ||
:command => "php /usr/local/bin/composer --stability=dev create-project projectzzz /my/subpar/project", | ||
:tries => 3, | ||
:timeout => 1200, | ||
|
@@ -39,7 +39,8 @@ | |
:repository_url => '[email protected]:trollface/whoadawg.git', | ||
:keep_vcs => true, | ||
:tries => 2, | ||
:timeout => 600 | ||
:timeout => 600, | ||
:user => 'mrploch', | ||
} } | ||
|
||
it { should include_class('git') } | ||
|
@@ -51,6 +52,7 @@ | |
:tries => 2, | ||
:timeout => 600, | ||
:creates => '/my/mediocre/project', | ||
:user => 'mrploch', | ||
}) | ||
} | ||
end | ||
|