From 5960a48effa6b0197a8eff1c3e832893022cffc8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 28 Oct 2018 16:32:45 +0900 Subject: [PATCH 01/31] =?UTF-8?q?=E5=90=84=E3=83=97=E3=83=A9=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=81=AB=E3=81=82=E3=82=8Bimg(css,js)?= =?UTF-8?q?=E3=82=92app/webroot/img(css,js)=E3=81=AB=E3=82=B3=E3=83=94?= =?UTF-8?q?=E3=83=BC=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86=E3=81=AE=E6=BC=8F?= =?UTF-8?q?=E3=82=8C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?361?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console/Command/Task/InstallMigrationsTask.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Console/Command/Task/InstallMigrationsTask.php b/Console/Command/Task/InstallMigrationsTask.php index 369a4ba..ea7b2c8 100644 --- a/Console/Command/Task/InstallMigrationsTask.php +++ b/Console/Command/Task/InstallMigrationsTask.php @@ -48,6 +48,11 @@ public function execute() { if (! $this->InstallUtil->installMigrations($connection, $plugins)) { return $this->error(__d('install', 'Failed to install migrations.')); } + + //Webrootへのコピー処理 + if (! $this->InstallUtil->installWebrootCopy()) { + return $this->error(__d('install', 'Failed to install webroot copies css,js,img')); + } } /** From 37cd3be5723d071fe1717383d3ff3bb8eae3d459 Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Mon, 5 Nov 2018 19:05:38 +0900 Subject: [PATCH 02/31] =?UTF-8?q?fix:=20=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=AB=E6=99=82=E3=81=AE=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=83=99=E3=83=BC=E3=82=B9=E8=A8=AD=E5=AE=9A=E3=80=81?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=81=AE=E8=AA=AC=E6=98=8E=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?https://github.com/NetCommons3/NetCommons3/issues/1254?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Install/init_db.ctp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/View/Install/init_db.ctp b/View/Install/init_db.ctp index 3840ce9..fe6ec3d 100644 --- a/View/Install/init_db.ctp +++ b/View/Install/init_db.ctp @@ -50,6 +50,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'label' => __d('install', 'Datasource'), 'div' => false, 'error' => false, + 'help' => __d('install', 'Select the type of database server to use.'), ) ); ?> @@ -60,6 +61,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'default' => $masterDB['host'], 'div' => false, 'error' => false, + 'help' => __d('install', "Enter the host name of the database server to use. If you do not understand well, there is almost no problem as 'localhost'."), ) ); ?> @@ -79,6 +81,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'default' => $masterDB['port'], 'div' => false, 'error' => false, + 'help' => __d('install', "Enter the port number of the database server to use. If you do not understand well, there is almost no problem as '3306'."), ) ); ?> @@ -98,6 +101,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'default' => 'nc3', 'div' => false, 'error' => false, + 'help' => __d('install', 'Enter the database name to use.'), ) ); ?> @@ -125,6 +129,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'placeholder' => 'nc3_', 'div' => false, 'error' => false, + 'help' => __d('install', "Table prefix of the database. This prefix is added to each table name to prevent duplication of names with existing tables. If you do not understand well, it is 'blank' and there is almost no problem."), ) ); ?> @@ -145,6 +150,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'placeholder' => __d('install', 'Username'), 'div' => false, 'error' => false, + 'help' => __d('install', 'User name of the database. Please enter the user account name in the above database.'), ) ); ?> @@ -164,6 +170,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); 'placeholder' => __d('install', 'Password'), 'div' => false, 'error' => false, + 'help' => __d('install', 'Enter the password with the above ID.'), ) ); ?> From 4cef40e77c2012f1753d68b2976f9db6fc495c44 Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Thu, 22 Nov 2018 20:46:22 +0900 Subject: [PATCH 03/31] =?UTF-8?q?feat:=20install=5Fbower=E3=81=A7#?= =?UTF-8?q?=E3=82=92=E5=90=AB=E3=82=93=E3=81=A0=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E6=8C=87=E5=AE=9A=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20https://github.com/NetCommons3/NetCommons3/issues/1367?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utility/InstallUtil.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index 3d49c3b..38d8017 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -693,22 +693,27 @@ public function installBowerPackages($update) { $file->close(); foreach ($bower['dependencies'] as $package => $version) { + if (strpos($version,'#') !== false) { + $install = $version; + } else { + $install = $package . '#' . $version; + } CakeLog::info( - sprintf('[bower] Start bower install %s#%s for %s', $package, $version, $plugin) + sprintf('[bower] Start bower install %s for %s', $install, $plugin) ); $messages = array(); $ret = null; exec(sprintf( - 'cd %s && `which bower` --allow-root install %s#%s --save', - ROOT, escapeshellcmd($package), escapeshellcmd($version) + 'cd %s && `which bower` --allow-root install %s --save', + ROOT, escapeshellcmd($install) ), $messages, $ret); // Write logs $this->__commandOutputResults('bower', $messages); CakeLog::info( - sprintf('[bower] Successfully bower install %s#%s for %s', $package, $version, $plugin) + sprintf('[bower] Successfully bower install %s for %s', $install, $plugin) ); } } From 477f447fadf9701372a1dbf02dfed3da4a522321 Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Sun, 25 Nov 2018 22:07:13 +0900 Subject: [PATCH 04/31] fix: phpcs fix --- Utility/InstallUtil.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index 38d8017..455e3e5 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -693,10 +693,10 @@ public function installBowerPackages($update) { $file->close(); foreach ($bower['dependencies'] as $package => $version) { - if (strpos($version,'#') !== false) { + if (strpos($version, '#') !== false) { $install = $version; } else { - $install = $package . '#' . $version; + $install = $package . '#' . $version; } CakeLog::info( sprintf('[bower] Start bower install %s for %s', $install, $plugin) From d7ec86f4b7b0279e2d79b4cebfc4aa7c5afc36ab Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 7 Jan 2019 23:39:17 +0900 Subject: [PATCH 05/31] =?UTF-8?q?VERSION=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=92=E5=AE=9A=E6=95=B0=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=81=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=AB=E3=81=82=E3=82=8B=E3=82=82=E3=81=AE=E3=81=8C?= =?UTF-8?q?=E7=8F=BE=E5=9C=A8=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=81=A8=E3=81=97=E3=81=A6=E6=89=B1=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console/Command/Task/InstallFinishTask.php | 6 ++++++ Controller/InstallController.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Console/Command/Task/InstallFinishTask.php b/Console/Command/Task/InstallFinishTask.php index 7629360..2cc6b67 100644 --- a/Console/Command/Task/InstallFinishTask.php +++ b/Console/Command/Task/InstallFinishTask.php @@ -11,6 +11,7 @@ App::uses('InstallAppTask', 'Install.Console/Command'); App::uses('Folder', 'Utility'); +App::uses('NetCommonsCache', 'NetCommons.Utility'); /** * Installの終了 @@ -73,6 +74,11 @@ public function execute() { $folder->delete(ROOT . DS . '.chef'); } + if (file_exists(APP . 'VERSION')) { + $ncCache = new NetCommonsCache('version', false, 'netcommons_core'); + $ncCache->write(trim(file_get_contents(APP . 'VERSION'))); + } + Configure::write('NetCommons.installed', true); $this->InstallUtil->saveAppConf(); } diff --git a/Controller/InstallController.php b/Controller/InstallController.php index d9a78f3..0d43ca8 100644 --- a/Controller/InstallController.php +++ b/Controller/InstallController.php @@ -12,6 +12,7 @@ App::uses('InstallAppController', 'Install.Controller'); App::uses('InstallUtil', 'Install.Utility'); App::uses('InstallValidatorUtil', 'Install.Utility'); +App::uses('NetCommonsCache', 'NetCommons.Utility'); /** * Install Controller @@ -314,6 +315,11 @@ public function save_init_data() { public function finish() { $this->set('pageTitle', __d('install', 'Installed')); + if (file_exists(APP . 'VERSION')) { + $ncCache = new NetCommonsCache('version', false, 'netcommons_core'); + $ncCache->write(trim(file_get_contents(APP . 'VERSION'))); + } + Configure::write('NetCommons.installed', true); /* Configure::write('NetCommons.installed', false); */ $this->InstallUtil->saveAppConf(); From 1a3a807cad6d5b2507635abb829dc882af5d7d31 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 18 Jan 2019 17:02:55 +0900 Subject: [PATCH 06/31] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E3=81=AF=E3=80=81?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1429?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utility/InstallUtil.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index 9209c86..0e4831c 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -625,6 +625,14 @@ public function installMigrations($connection = 'master', $addPlugins = [], $opt } } + //キャッシュの削除 + Cache::clear(false, '_cake_model_'); + Cache::clear(false, '_cake_core_'); + + //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 + $dataSource = ConnectionManager::getDataSource($connection); + $dataSource->reconnect(); + $Plugin = ClassRegistry::init(Hash::get($options, 'PluginModel', 'PluginManager.Plugin')); if ($Plugin->updateVersionByComposer()) { CakeLog::info('[migration] Successfully updated version of composer plugins.'); From ef03b0bbf78b61f27ccb0367e82ff06e7cd73707 Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Fri, 25 Jan 2019 11:30:05 +0900 Subject: [PATCH 07/31] =?UTF-8?q?fix:=20NetCommonsForm->create,=20end?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=AB=E7=B5=B1=E4=B8=80=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1438?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Install/index.ctp | 4 ++-- View/Install/init_admin_user.ctp | 4 ++-- View/Install/init_permission.ctp | 4 ++-- View/Install/init_site_setting.ctp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/View/Install/index.ctp b/View/Install/index.ctp index db8855b..80eea59 100644 --- a/View/Install/index.ctp +++ b/View/Install/index.ctp @@ -21,7 +21,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); -Form->create(false, array('url' => array( +NetCommonsForm->create(false, array('url' => array( //'plugin' => 'install', //'controller' => 'install', 'action' => 'index', @@ -75,4 +75,4 @@ from this site, etc.'), -Form->end(); +NetCommonsForm->end(); diff --git a/View/Install/init_admin_user.ctp b/View/Install/init_admin_user.ctp index 7fbbd3c..71700f1 100644 --- a/View/Install/init_admin_user.ctp +++ b/View/Install/init_admin_user.ctp @@ -13,7 +13,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); ?> Form->create(false, + echo $this->NetCommonsForm->create(false, array( 'url' => array( //'plugin' => 'install', @@ -88,4 +88,4 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); -Form->end(); +NetCommonsForm->end(); diff --git a/View/Install/init_permission.ctp b/View/Install/init_permission.ctp index 8fe96e7..76c4858 100644 --- a/View/Install/init_permission.ctp +++ b/View/Install/init_permission.ctp @@ -12,7 +12,7 @@ echo $this->NetCommonsHtml->script('/install/js/install.js'); echo $this->NetCommonsHtml->css('/install/css/install.css'); ?> -Form->create(false, array('url' => array( +NetCommonsForm->create(false, array('url' => array( //'plugin' => 'install', //'controller' => 'install', 'action' => 'init_permission', @@ -96,4 +96,4 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); -Form->end(); +NetCommonsForm->end(); diff --git a/View/Install/init_site_setting.ctp b/View/Install/init_site_setting.ctp index 49d699f..9e7cf35 100644 --- a/View/Install/init_site_setting.ctp +++ b/View/Install/init_site_setting.ctp @@ -20,7 +20,7 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); Form->create(false, + echo $this->NetCommonsForm->create(false, array( 'url' => array( //'plugin' => 'install', @@ -57,4 +57,4 @@ echo $this->NetCommonsHtml->css('/install/css/install.css'); -Form->end(); +NetCommonsForm->end(); From be6103531cb7892c52c1a0e1d23b654dfb733d85 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 13 Feb 2019 12:06:32 +0900 Subject: [PATCH 08/31] =?UTF-8?q?=E4=B8=8B=E8=A8=98=E3=81=AE=E7=90=86?= =?UTF-8?q?=E7=94=B1=E3=81=AB=E3=82=88=E3=82=8A=E3=80=81DB=E3=81=AE?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E3=82=92InstallStartTask=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=81CreateDatabaseTask=E5=86=85?= =?UTF-8?q?=E3=81=A7=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20=E3=82=B7=E3=82=A7=E3=83=AB=E3=81=A7=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E9=9A=9B=E3=80=81databasa.php=E3=81=AE=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E3=81=AF=E5=A4=89=E3=81=88=E3=81=9A=E3=81=AB?= =?UTF-8?q?=E3=80=81application.yml=E3=81=A0=E3=81=91=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=9F=E3=81=84=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E3=81=9F=E3=82=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console/Command/Task/CreateDatabaseTask.php | 11 +++++++++++ Console/Command/Task/InstallStartTask.php | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Console/Command/Task/CreateDatabaseTask.php b/Console/Command/Task/CreateDatabaseTask.php index 0f9c091..f41cf48 100644 --- a/Console/Command/Task/CreateDatabaseTask.php +++ b/Console/Command/Task/CreateDatabaseTask.php @@ -76,6 +76,17 @@ class CreateDatabaseTask extends InstallAppTask { public function execute() { parent::execute(); + //database.phpの初期化処理 + $configs = $this->InstallUtil->chooseDBByEnvironment(); + if (! $this->InstallUtil->saveDBConf($configs)) { + $message = __d( + 'install', + 'Failed to write %s. Please check permission.', + array(APP . 'Config' . DS . 'database.php') + ); + return $this->error($message); + } + //引数のセット $this->__prepare(); diff --git a/Console/Command/Task/InstallStartTask.php b/Console/Command/Task/InstallStartTask.php index 6995391..aa2f0c9 100644 --- a/Console/Command/Task/InstallStartTask.php +++ b/Console/Command/Task/InstallStartTask.php @@ -88,17 +88,6 @@ public function execute() { ); return $this->error($message); } - - //database.phpの初期化処理 - $configs = $this->InstallUtil->chooseDBByEnvironment(); - if (! $this->InstallUtil->saveDBConf($configs)) { - $message = __d( - 'install', - 'Failed to write %s. Please check permission.', - array(APP . 'Config' . DS . 'database.php') - ); - return $this->error($message); - } } /** From d549ea76e165df1e56795cdbcfbab3b24c3e0322 Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sun, 6 Oct 2019 23:49:47 +0900 Subject: [PATCH 09/31] =?UTF-8?q?fix:=20test:=20travis=E3=81=AEphp7.2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1451 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b6975cd..9cc79b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,10 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false +dist: trusty env: matrix: From 0a0c57f71fd7a5cdfc16321a11031105f2ac3255 Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sun, 6 Oct 2019 23:50:50 +0900 Subject: [PATCH 10/31] =?UTF-8?q?fix:=20test:=20travis=E3=81=AEphp7.2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1451 --- phpunit.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 24eff13..b9c22eb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - From a5d2ef3977897d10443e1b36b48efbc94ea5b6cf Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 7 Oct 2019 08:19:47 +0900 Subject: [PATCH 11/31] =?UTF-8?q?fix:=20test:=20UnitTest=E3=81=A7=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?alias=E3=82=92=E4=BB=98=E4=B8=8E=E3=81=99=E3=82=8B=20https://gi?= =?UTF-8?q?thub.com/NetCommons3/NetCommons3/issues/1468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utility/InstallUtil.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index 0e4831c..da53939 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -608,10 +608,10 @@ public function installMigrations($connection = 'master', $addPlugins = [], $opt $SiteSetting->setDataSource($connection); $conditions = array( - 'key' => 'Config.language' + 'SiteSetting.key' => 'Config.language' ); $update = array( - 'value' => '\'' . Configure::read('Config.language') . '\'' + 'SiteSetting.value' => '\'' . Configure::read('Config.language') . '\'' ); if (! $SiteSetting->updateAll($update, $conditions)) { CakeLog::info( From b531be7a921b88b494a66a5529ad24899743bd6f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 7 Oct 2019 10:36:46 +0900 Subject: [PATCH 12/31] =?UTF-8?q?fix:=20php7.2=E3=81=A7=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/InstallController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/InstallController.php b/Controller/InstallController.php index 0d43ca8..9e96cb3 100644 --- a/Controller/InstallController.php +++ b/Controller/InstallController.php @@ -42,7 +42,8 @@ public function beforeFilter() { $this->layout = 'Install.default'; //テストのために必要 - if (substr(get_class($this->InstallUtil), 0, strlen('Mock_')) !== 'Mock_') { + if (empty($this->InstallUtil) || + substr(get_class($this->InstallUtil), 0, strlen('Mock_')) !== 'Mock_') { $this->InstallUtil = new InstallUtil(); } From a06240ba0d4c77b1ec9b7a364337966ee85da04a Mon Sep 17 00:00:00 2001 From: watura Date: Wed, 20 Nov 2019 10:06:53 +0900 Subject: [PATCH 13/31] fix(migration): Blocks requires Rooms Tables --- Utility/InstallUtil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index da53939..d4a8976 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -210,7 +210,7 @@ class InstallUtil { */ public $migrationPriorityPlugins = array( 'Files', 'Users', 'NetCommons', 'M17n', 'DataTypes', 'PluginManager', - 'Roles', 'Mails', 'SiteManager', 'Blocks', 'Boxes' + 'Roles', 'Mails', 'SiteManager', 'Rooms', 'Blocks', 'Boxes' ); /** From 5af316b7d977d29e9172c6e34260b851939a2880 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Mar 2020 22:59:36 +0900 Subject: [PATCH 14/31] =?UTF-8?q?change:=20test:=20travis.yml=E3=81=8B?= =?UTF-8?q?=E3=82=89php5.4,5.5=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82php7.3,7?= =?UTF-8?q?.4=E3=82=92=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/?= =?UTF-8?q?NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9cc79b0..56c0fb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 sudo: false dist: trusty From f2a4e7da3879163c5df829482cdf58046dbee3d0 Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sat, 11 Jul 2020 19:00:18 +0900 Subject: [PATCH 15/31] =?UTF-8?q?fix:=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=EF=BC=88Memcache=E7=AD=89=EF=BC=89=E3=81=A7Cache::cle?= =?UTF-8?q?ar=E3=81=97=E3=81=A6=E3=82=82DataSource=E5=86=85=E3=81=AE=5Fsou?= =?UTF-8?q?rces=E3=81=8C=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1585 --- Utility/InstallUtil.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index d4a8976..b2a3b9f 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -631,6 +631,7 @@ public function installMigrations($connection = 'master', $addPlugins = [], $opt //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 $dataSource = ConnectionManager::getDataSource($connection); + $dataSource->cacheSources = false; $dataSource->reconnect(); $Plugin = ClassRegistry::init(Hash::get($options, 'PluginModel', 'PluginManager.Plugin')); From 55a65bf59f52d03e37775c7f5fa1eae417ed4c5e Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sat, 11 Jul 2020 22:53:14 +0900 Subject: [PATCH 16/31] =?UTF-8?q?fix:=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=EF=BC=88Memcache=E7=AD=89=EF=BC=89=E3=81=A7Cache::cle?= =?UTF-8?q?ar=E3=81=97=E3=81=A6=E3=82=82DataSource=E5=86=85=E3=81=AE=5Fsou?= =?UTF-8?q?rces=E3=81=8C=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1585 --- Utility/InstallUtil.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index b2a3b9f..ebc7980 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -15,6 +15,7 @@ App::uses('Security', 'Utility'); App::uses('ClassRegistry', 'Utility'); App::uses('InstallValidatorUtil', 'Install.Utility'); +App::uses('ConnectionManager', 'Model'); /** * Install Utility @@ -523,6 +524,11 @@ public function createDB($configuration) { * @return void */ public function saveAdminUser($data) { + //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 + $dataSource = ConnectionManager::getDataSource('master'); + $dataSource->cacheSources = false; + $dataSource->reconnect(); + //テストでMockに差し替えが必要なための処理であるので、カバレッジレポートから除外する。 //@codeCoverageIgnoreStart if (empty($this->User) || substr(get_class($this->User), 0, 4) !== 'Mock') { From b70c41635f86d20f77904fddf2843713fe26ef55 Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Sat, 11 Jul 2020 23:17:56 +0900 Subject: [PATCH 17/31] =?UTF-8?q?fix:=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=EF=BC=88Memcache=E7=AD=89=EF=BC=89=E3=81=A7Cache::cle?= =?UTF-8?q?ar=E3=81=97=E3=81=A6=E3=82=82DataSource=E5=86=85=E3=81=AE=5Fsou?= =?UTF-8?q?rces=E3=81=8C=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1585 --- Utility/InstallUtil.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Utility/InstallUtil.php b/Utility/InstallUtil.php index ebc7980..3a8cef4 100644 --- a/Utility/InstallUtil.php +++ b/Utility/InstallUtil.php @@ -524,11 +524,6 @@ public function createDB($configuration) { * @return void */ public function saveAdminUser($data) { - //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 - $dataSource = ConnectionManager::getDataSource('master'); - $dataSource->cacheSources = false; - $dataSource->reconnect(); - //テストでMockに差し替えが必要なための処理であるので、カバレッジレポートから除外する。 //@codeCoverageIgnoreStart if (empty($this->User) || substr(get_class($this->User), 0, 4) !== 'Mock') { @@ -666,6 +661,15 @@ public function installMigrations($connection = 'master', $addPlugins = [], $opt CakeLog::info('[migration] Failure migrated all plugins'); } + //DataSourceの中にあるlistSources()の$this->_sources変数を初期化することができないため、reconnect()する。 + $dataSource = ConnectionManager::getDataSource('master'); + $dataSource->cacheSources = false; + $dataSource->reconnect(); + + //キャッシュの削除 + Cache::clear(false, '_cake_model_'); + Cache::clear(false, '_cake_core_'); + return $result; } From 86921ed0776b398f6a298683a1dd1e3944822809 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 8 Aug 2020 21:53:01 +0900 Subject: [PATCH 18/31] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B?= =?UTF-8?q?=E3=82=89PHP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=81=A7UnitTest=E3=81=A7Warning=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - phpunit.xml.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56c0fb5..e2b107b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b9c22eb..4139a1d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,11 @@ + + + + + + app/Plugin/Install From 59442dae31052011787c32cd0e195296d714f1d3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 26 Aug 2020 20:19:01 +0900 Subject: [PATCH 19/31] change: Version number to 3.3.2 --- VERSION.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..4772543 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +3.3.2 From 94007c3c89187912f5424ed43165232a1a407268 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 17:02:18 +0900 Subject: [PATCH 20/31] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e2b107b..6b66641 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From 5b89445d11223af03ef4af675cf49415c62efa84 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:57:44 +0900 Subject: [PATCH 21/31] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 9a5af8d157aa1362cb32d4f63951831c5c815db9 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:57:49 +0900 Subject: [PATCH 22/31] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From a6b5133d92ad3532408578c2abced9dc4231d7b4 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 31 Jul 2021 10:11:36 +0900 Subject: [PATCH 23/31] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 9 +-- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b66641..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "PZ/zmD6ZnBGARSJnpH4PqX+iBx3N2n/foc9CLg4EQmZYKNb4gNwpQwuqIjM4IvBxl3P7gMIlbfbyOaOXdwbpgwkcIl+cAkl3rVzvKeLUWfbtnpZ2ObCzEo2iGdIPJ52RHRJG4ZEryXz7bKeVWvZnBQ0+clX4avYTS5ZdQ9+imuY=" - - GIT_COMMITTER_NAME=s-nakajima - - GIT_COMMITTER_EMAIL=nakajimashouhei@gmail.com - - GIT_AUTHOR_NAME=s-nakajima - - GIT_AUTHOR_EMAIL=nakajimashouhei@gmail.com - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - travis_wait . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index e178467..08d5225 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ Install =========== -[![Build Status](https://travis-ci.org/NetCommons3/Install.png?branch=master)](https://travis-ci.org/NetCommons3/Install) -[![Coverage Status](https://coveralls.io/repos/NetCommons3/Install/badge.png?branch=master)](https://coveralls.io/r/NetCommons3/Install?branch=master) - -| dependencies | status | -| ------------ | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/5397f08a83add7bd8d000022/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5397f08a83add7bd8d000022) | +[![Tests Status](https://github.com/NetCommons3/Install/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/Install/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/Install/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/Install?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/install.svg?label=stable)](https://packagist.org/packages/netcommons/install) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4139a1d..46a3df4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/Install @@ -20,5 +17,6 @@ + From 9635eacceb2ab59f9700ee9d8609ec6604f64b4c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 11 Aug 2021 10:06:14 +0900 Subject: [PATCH 24/31] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From bfca62f88a81bcad5334cc102c205931f9751a2e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 11 Aug 2021 11:42:57 +0900 Subject: [PATCH 25/31] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utility/InstallUtil/InstallMigrationsTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Test/Case/Utility/InstallUtil/InstallMigrationsTest.php b/Test/Case/Utility/InstallUtil/InstallMigrationsTest.php index 229b803..b336336 100644 --- a/Test/Case/Utility/InstallUtil/InstallMigrationsTest.php +++ b/Test/Case/Utility/InstallUtil/InstallMigrationsTest.php @@ -79,12 +79,18 @@ private function __databaseClear() { $this->__initTableCount = 0; foreach ($tables as $table) { - $tableName = array_shift($table['TABLE_NAMES']); + $tableName = null; + if (array_key_exists('TABLE_NAMES', $table)) { + $tableName = array_shift($table['TABLE_NAMES']); + } elseif (array_key_exists('TABLES', $table)) { + $tableName = array_shift($table['TABLES']); + } + if (preg_match('/schema_migrations$/', $tableName)) { - $db->query('DELETE FROM ' . $tableName . ' WHERE type != \'Migrations\''); + $db->query('DELETE FROM `' . $tableName . '` WHERE type != \'Migrations\''); $this->__initTableCount++; } else { - $db->query('DROP TABLE ' . $tableName); + $db->query('DROP TABLE `' . $tableName . '`'); } } } From 787dd84c73f6f5f99ea2f5ff6d42e12a2289c7cb Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 16:07:15 +0900 Subject: [PATCH 26/31] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From d8413659ad04ac08243905865061c77142363c19 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 19:42:26 +0900 Subject: [PATCH 27/31] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From db25b6f911ae5cd4d1399b3da5717626df95c670 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 14:38:47 +0900 Subject: [PATCH 28/31] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,10 +44,14 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +62,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From bc43fdc9e8ed86d4215355a3ac035f8354f74a6f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 00:52:21 +0900 Subject: [PATCH 29/31] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From aa8c083174daeea6a62eff72a26665e88973513a Mon Sep 17 00:00:00 2001 From: Shohei Nakajima Date: Thu, 5 Oct 2023 16:02:44 +0900 Subject: [PATCH 30/31] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,11 @@ name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +29,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +93,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +147,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +156,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From ffccf70fcad9782d9ecf1086245dd7f0b6de80cc Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 18:36:28 +0900 Subject: [PATCH 31/31] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7