Skip to content

Commit f3997cb

Browse files
committed
Implement debug setting everywhere
1 parent 789e6c4 commit f3997cb

File tree

5 files changed

+44
-34
lines changed

5 files changed

+44
-34
lines changed

Modulefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ dependency 'puppetlabs/apt','>=1.0.0'
1414
dependency 'example42/php','>=2.0.17'
1515
dependency 'example42/puppi','>=1.0.0'
1616

17-
version '1.0.59'
17+
version '1.0.60'

manifests/deps/devtools.pp

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,34 @@
33
# Parameters:
44
# [*version*] - desired devtools version - See https://github.com/phalcon/phalcon-devtools/branches for valid branch names
55
class phalconphp::deps::devtools (
6-
$version = '1.3.x') {
6+
$version = '1.3.x',
7+
$debug = false) {
78
exec { 'git-clone-devtools':
8-
command => "sudo git clone https://github.com/phalcon/phalcon-devtools.git -b ${version}",
9-
cwd => "/usr/share/php",
10-
unless => "test -d ./phalcon-devtools",
11-
require => [
9+
command => "sudo git clone https://github.com/phalcon/phalcon-devtools.git -b ${version}",
10+
cwd => "/usr/share/php",
11+
unless => "test -d ./phalcon-devtools",
12+
require => [
1213
Package['php'],
13-
Class['phalconphp::deps::sys']]
14+
Class['phalconphp::deps::sys']],
15+
logoutput => $debug
1416
}
1517

1618
exec { 'git-pull-devtools':
17-
command => "sudo git pull",
18-
cwd => "/usr/share/php/phalcon-devtools",
19-
onlyif => "sudo test -d ./phalcon-devtools",
20-
require => [Exec['git-clone-devtools']]
19+
command => "sudo git pull",
20+
cwd => "/usr/share/php/phalcon-devtools",
21+
onlyif => "sudo test -d ./phalcon-devtools",
22+
require => [Exec['git-clone-devtools']],
23+
logoutput => $debug
2124
}
2225

2326
file { '/usr/bin/phalcon':
24-
ensure => link,
25-
path => '/usr/bin/phalcon',
26-
target => "/usr/share/php/phalcon-devtools/phalcon.php",
27-
require => [
27+
ensure => link,
28+
path => '/usr/bin/phalcon',
29+
target => "/usr/share/php/phalcon-devtools/phalcon.php",
30+
require => [
2831
Class['phalconphp::framework'],
29-
Exec['git-pull-devtools']]
32+
Exec['git-pull-devtools']],
33+
loglevel => 'notice'
3034
}
3135

3236
file { '/usr/share/php/phalcon-devtools':
@@ -38,9 +42,10 @@
3842
}
3943

4044
exec { 'chmod+x-devtools':
41-
command => 'chmod ugo+x /usr/bin/phalcon',
42-
require => [
45+
command => 'chmod ugo+x /usr/bin/phalcon',
46+
require => [
4347
File['/usr/share/php/phalcon-devtools'],
44-
File['/usr/bin/phalcon']]
48+
File['/usr/bin/phalcon']],
49+
logoutput => $debug
4550
}
4651
}

manifests/deps/jsonc.pp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
# Class: phalconphp::deps::jsonc
22
# Installs json-c (https://github.com/json-c/json-c)
33

4-
class phalconphp::deps::jsonc {
4+
class phalconphp::deps::jsonc (
5+
$debug = false) {
56
include phalconphp::deps::sys
67

78
exec { 'git-clone-json-c':
89
command => 'git clone https://github.com/json-c/json-c.git',
910
cwd => '/tmp',
1011
unless => 'test -d /tmp/json-c',
11-
logoutput => true,
12+
logoutput => $debug,
1213
require => [Class['phalconphp::deps::sys']]
1314
} ->
1415
exec { 'git-pull-json-c':
1516
command => 'git pull',
1617
cwd => '/tmp/json-c',
1718
onlyif => 'test -d /tmp/json-c',
1819
require => [Exec['git-clone-json-c']],
19-
logoutput => true
20+
logoutput => $debug
2021
} ->
2122
exec { 'autogen-json-c':
2223
command => 'sh ./autogen.sh',
2324
cwd => '/tmp/json-c',
24-
logoutput => true,
25+
logoutput => $debug,
2526
require => [Exec['git-pull-json-c']],
2627
} ->
2728
exec { 'configure-json-c':
2829
command => '/tmp/json-c/configure',
2930
cwd => '/tmp/json-c',
3031
onlyif => 'test -f /tmp/json-c/configure',
3132
require => [Exec['autogen-json-c']],
32-
logoutput => true
33+
logoutput => $debug
3334
} ->
3435
exec { 'make-json-c':
3536
command => "make -j${::processorcount}",
@@ -40,7 +41,7 @@
4041
exec { 'install-json-c':
4142
command => "sudo make -j${::processorcount} install",
4243
cwd => '/tmp/json-c',
43-
logoutput => true,
44+
logoutput => $debug,
4445
require => [Exec['make-json-c']]
4546
} ->
4647
exec { 'remove-json-c-source':

manifests/deps/zephir.pp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
# Class: phalconphp::deps::zephir
22
# Installs Zephir (http://zephir-lang.com/)
3-
class phalconphp::deps::zephir {
4-
include phalconphp::deps::jsonc
3+
class phalconphp::deps::zephir (
4+
$debug = false) {
5+
class { 'phalconphp::deps::jsonc': debug => $debug }
56

67
exec { 'git-clone-zephir':
78
command => 'git clone https://github.com/phalcon/zephir.git',
89
cwd => '/tmp',
910
unless => 'test -d /tmp/zephir',
1011
require => [Class['phalconphp::deps::sys']],
11-
logoutput => true,
12+
logoutput => $debug
1213
} ->
1314
exec { 'git-pull-zephir':
1415
command => 'git pull',
1516
cwd => '/tmp/zephir',
1617
onlyif => 'test -d /tmp/zephir',
17-
logoutput => true,
18+
logoutput => $debug
1819
} ->
1920
exec { 'install-zephir':
2021
command => './install -c',
2122
cwd => '/tmp/zephir',
2223
require => [Class['phalconphp::deps::jsonc']],
23-
logoutput => true,
24+
logoutput => $debug,
2425
} ->
2526
exec { 'check-zephir':
2627
command => 'zephir version',
27-
logoutput => true,
28+
logoutput => $debug,
2829
require => [Exec['install-zephir']]
2930
}
30-
}
31+
}

manifests/init.pp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
# Install zephir
6666
if $install_zephir == true {
67-
include phalconphp::deps::zephir
67+
class { 'phalconphp::deps::zephir': debug => $debug }
6868
}
6969

7070
# Install the actual framework
@@ -77,6 +77,9 @@
7777

7878
# Install the phalconphp dev tools
7979
if $install_devtools == true {
80-
class { 'phalconphp::deps::devtools': version => $devtools_version }
80+
class { 'phalconphp::deps::devtools':
81+
version => $devtools_version,
82+
debug => $debug
83+
}
8184
}
8285
}

0 commit comments

Comments
 (0)