Skip to content

Commit 2fa2136

Browse files
committed
Implemented the "instance" argument.
1 parent a4a99ed commit 2fa2136

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/LdapGroupSyncCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ public function execute(InputInterface $input, OutputInterface $output): ?int
118118
// Deploy to Gitlab instances
119119
$this->logger->notice("Deploying groups and users to Gitlab instances.");
120120

121+
$gitlabInstanceOnly = trim($input->getArgument("instance", null));
121122
foreach ($config["gitlab"]["instances"] as $gitlabInstance => $gitlabConfig) {
123+
if ($gitlabInstanceOnly && $gitlabInstance !== $gitlabInstanceOnly) {
124+
$this->logger->debug(sprintf("Skipping instance \"%s\", doesn't match the argument specified.", $gitlabInstance));
125+
continue;
126+
}
127+
122128
try {
123129
$this->deployGitlabGroupsAndUsers($config, $gitlabInstance, $gitlabConfig, $ldapGroups, $ldapGroupsNum, $ldapUsers, $ldapUsersNum);
124130
} catch (\Exception $e) {

0 commit comments

Comments
 (0)