Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 164 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ clone:

steps:
- name: app-code-check
image: nextcloudci/php7.2:php7.2-13
image: nextcloudci/php7.4:php7.4-2
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: master
Expand All @@ -21,7 +21,7 @@ steps:
image: nextcloudci/php7.2:php7.2-13
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: master
CORE_BRANCH: stable20
DB: sqlite
commands:
- composer install
Expand All @@ -36,7 +36,7 @@ steps:
- composer install
- ./vendor/bin/parallel-lint --exclude ./vendor/ .
- name: syntax-php7.4
image: nextcloudci/php7.4:php7.4-1
image: nextcloudci/php7.4:php7.4-2
environment:
APP_NAME: ldap_write_support
CORE_BRANCH: master
Expand Down Expand Up @@ -111,3 +111,164 @@ trigger:
- push

type: docker

---
kind: pipeline
name: tests-master

clone:
depth: 1

steps:
- name: php7.3
image: nextcloudci/php7.3:php7.3-5
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: master
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml
- name: php7.4
image: nextcloudci/php7.4:php7.4-1
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: master
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml

trigger:
branch:
- master
- stable*
event:
- pull_request
- push

type: docker

---
kind: pipeline
name: tests-stable20

clone:
depth: 1

steps:
- name: php7.2
image: nextcloudci/php7.2:php7.2-13
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable20
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml
- name: php7.3
image: nextcloudci/php7.3:php7.3-5
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable20
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml
- name: php7.4
image: nextcloudci/php7.4:php7.4-2
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable20
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml

trigger:
branch:
- master
- stable*
event:
- pull_request
- push

type: docker

---
kind: pipeline
name: tests-stable19

clone:
depth: 1

steps:
- name: php7.2
image: nextcloudci/php7.2:php7.2-13
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable19
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml
- name: php7.3
image: nextcloudci/php7.3:php7.3-5
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable19
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml
- name: php7.4
image: nextcloudci/php7.4:php7.4-2
environment:
APP_NAME: ldap_contacts_backend
CORE_BRANCH: stable19
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- composer install
- cd tests/phpunit/
- phpunit --configuration phpunit.xml

trigger:
branch:
- master
- stable*
event:
- pull_request
- push

type: docker
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Given that the configuration is correct, you and your users will be able to sear
<dependencies>
<php min-version="7.2"/>
<lib>ldap</lib>
<nextcloud min-version="19" max-version="20"/>
<nextcloud min-version="19" max-version="21"/>
</dependencies>
<commands>
<command>OCA\LDAPContactsBackend\Command\Add</command>
Expand Down
7 changes: 3 additions & 4 deletions lib/Command/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
namespace OCA\LDAPContactsBackend\Command;

use OC\Core\Command\Base;
use OCA\LDAPContactsBackend\Model\LDAPBaseConfiguration;
use OCA\LDAPContactsBackend\Service\Configuration;
use OCA\LDAPContactsBackend\Service\ConnectionImporter;
use Symfony\Component\Console\Helper\QuestionHelper;
Expand All @@ -40,10 +39,10 @@ class Add extends Base {

/** @var Configuration */
private $configurationService;
/** @var ConnectionImporter */
/** @var ConnectionImporter|null */
private $connectionImporter;

public function __construct(Configuration $configurationService, ConnectionImporter $connectionImporter) {
public function __construct(Configuration $configurationService, ?ConnectionImporter $connectionImporter = null) {
parent::__construct();
$this->configurationService = $configurationService;
$this->connectionImporter = $connectionImporter;
Expand Down Expand Up @@ -282,7 +281,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {

protected function importConnection(InputInterface $input) {
static $wasRun = false;
if($wasRun) {
if($wasRun || !$this->connectionImporter instanceof ConnectionImporter) {
// avoid running twice during interact && executed
return;
}
Expand Down