Skip to content

Commit

Permalink
🐛 : correct Gitlab url pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Jan 17, 2020
1 parent c999ddc commit d977e8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/main/java/io/codeka/gaia/registries/config/RegistryConfig.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package io.codeka.gaia.registries.config;

import io.codeka.gaia.registries.RegistryOAuth2Provider;
import io.codeka.gaia.registries.RegistryRawContent;
import io.codeka.gaia.registries.github.GitHubOAuth2Provider;
import io.codeka.gaia.registries.github.GitHubRawContent;
import io.codeka.gaia.registries.gitlab.GitLabOAuth2Provider;
import io.codeka.gaia.registries.gitlab.GitLabRawContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.List;

Expand All @@ -19,11 +14,6 @@
@Configuration
public class RegistryConfig {

@Bean
List<RegistryRawContent> registryRawContents(@Autowired RestTemplate restTemplate) {
return List.of(new GitHubRawContent(restTemplate), new GitLabRawContent(restTemplate));
}

@Bean
List<RegistryOAuth2Provider> registryOAuth2Providers() {
return List.of(new GitHubOAuth2Provider(), new GitLabOAuth2Provider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package io.codeka.gaia.registries.gitlab

import io.codeka.gaia.registries.RegistryType
import io.codeka.gaia.registries.RegistryRawContent
import org.springframework.stereotype.Component
import org.springframework.web.client.RestTemplate
import java.util.regex.Pattern

@Component
class GitLabRawContent(restTemplate: RestTemplate) : RegistryRawContent(RegistryType.GITLAB, restTemplate) {

override val pattern: Pattern = Pattern.compile("^(http[s]?://[www.]?gitlab.*).git$")
override val pattern: Pattern = Pattern.compile("^https?://(w{3}\\.)?gitlab.*(.git)?$")

}

0 comments on commit d977e8b

Please sign in to comment.