Merge branch 'svn-fixes'

This commit is contained in:
Dmitry Khomutov 2018-04-15 16:37:28 +07:00
commit 23664bdcbf
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
4 changed files with 18 additions and 13 deletions

View file

@ -7,7 +7,8 @@ look something like this:
```yml
build_settings:
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
# WORKS ONLY IN IN-DATABASE PROJECT CONFIG! Clone depth of 1 is a shallow clone, remove this line to clone entire repo (For Git and Svn only).
clone_depth: 1
ignore:
- "vendor"
- "tests"
@ -15,6 +16,10 @@ build_settings:
host: "localhost"
user: "root"
pass: ""
# WORKS ONLY IN IN-DATABASE PROJECT CONFIG! Svn additional CLI options (For example: --username='username').
svn:
username: "username"
password: "password"
setup:
mysql:

View file

@ -76,7 +76,7 @@ class GitBuild extends Build
$cmd = 'cd .. && git clone --recursive ';
$buildSettings = $builder->getConfig('build_settings');
if ($buildSettings && isset($buildSettings['clone_depth'])) {
if ($buildSettings && isset($buildSettings['clone_depth']) && (0 < (integer)$buildSettings['clone_depth'])) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
}
@ -102,7 +102,7 @@ class GitBuild extends Build
$cmd = 'cd .. && git clone --recursive ';
$buildSettings = $builder->getConfig('build_settings');
if ($buildSettings && isset($buildSettings['clone_depth'])) {
if ($buildSettings && isset($buildSettings['clone_depth']) && (0 < (integer)$buildSettings['clone_depth'])) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
}

View file

@ -47,16 +47,17 @@ class SvnBuild extends Build
{
$cmd = $this->svnCommand;
$svn = $builder->getConfig('svn');
if ($svn) {
foreach ($svn as $key => $value) {
$cmd .= " --${key} ${value} ";
}
}
$buildSettings = $builder->getConfig('build_settings');
if ($buildSettings && isset($buildSettings['clone_depth'])) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
if ($buildSettings) {
if (isset($buildSettings['svn']) && is_array($buildSettings['svn'])) {
foreach ($buildSettings['svn'] as $key => $value) {
$cmd .= " --${key} ${value} ";
}
}
if (isset($buildSettings['clone_depth']) && 0 < (integer)$buildSettings['clone_depth']) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
}
}
$this->svnCommand = $cmd;

View file

@ -53,7 +53,6 @@ class Mysql extends Plugin
$this->pass = $config['pass'];
$buildSettings = $this->builder->getConfig('build_settings');
if (!isset($buildSettings['mysql'])) {
return;
}