From a9ac06cb0e7818aeb67261a3db1fc3175aaab36b Mon Sep 17 00:00:00 2001 From: Thibault Meyer Date: Wed, 6 Jan 2021 19:19:05 +0100 Subject: [PATCH] Prepare for Release 21.01 --- pom.xml | 2 +- .../io/playrconf/provider/GitProvider.java | 30 ++++++++++--------- .../playrconf/provider/GitProviderTest.java | 22 +++++++------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 8e4cb8a..f6c589c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.play-rconf play-rconf-git - 20.10 + 21.01 Play Remote Configuration - GIT Retrieves configuration hosted on a GIT repository https://github.com/play-rconf/play-rconf-git diff --git a/src/main/java/io/playrconf/provider/GitProvider.java b/src/main/java/io/playrconf/provider/GitProvider.java index f80a6dd..873588d 100644 --- a/src/main/java/io/playrconf/provider/GitProvider.java +++ b/src/main/java/io/playrconf/provider/GitProvider.java @@ -62,9 +62,9 @@ /** * Retrieves configuration hosted behind a Git repository. * You can use three authentication modes: - * 1. None (Used for public repositories); - * 2. User (Used for private repositories over HTTPS); - * 3. SSH-RSA (Used for private repositories over SSH with a RSA Private Key). + * 1. None (Used for public repositories); + * 2. User (Used for private repositories over HTTPS); + * 3. SSH-RSA (Used for private repositories over SSH with a RSA Private Key). * * @author Felipe Bonezi * @since 20.10.29 @@ -173,7 +173,8 @@ public void loadData(final Config config, /** * Check if all required fields are set in the project config file. - * @param config Config file. + * + * @param config Config file */ private void checkRequiredConfigFields(final Config config) throws ConfigException { if (!config.hasPath("mode") || config.getString("mode").isEmpty()) @@ -212,10 +213,10 @@ private void checkRequiredConfigFields(final Config config) throws ConfigExcepti /** * Clones main branch of Git repository. * - * @param config Config file. - * @param repositoryURI Repository URI using HTTPS or SSH. - * @param mode Auth mode. - * @return Repository. + * @param config Config file + * @param repositoryURI Repository URI using HTTPS or SSH + * @param mode Auth mode + * @return Repository */ private Repository cloneRepository(final Config config, final String repositoryURI, final String mode) throws GitAPIException, IOException { final String dirPath = String.format("play-rconf-git-%s", System.currentTimeMillis()); @@ -230,7 +231,7 @@ private Repository cloneRepository(final Config config, final String repositoryU @Override protected JSch createDefaultJSch(final FS fs) throws JSchException { - // SSH configuration (Optional password). + // SSH configuration (Optional password) final String privateKey = config.getString("ssh-rsa.private-key"); final String password = config.hasPath("ssh-rsa.password") ? config.getString("ssh-rsa.password") : null; @@ -253,7 +254,7 @@ protected JSch createDefaultJSch(final FS fs) throws JSchException { break; default: - // Public repository over HTTPS. + // Public repository over HTTPS break; } @@ -262,10 +263,11 @@ protected JSch createDefaultJSch(final FS fs) throws JSchException { /** * Read config file from repository. - * @param repository Repository ref. - * @param commit Last commit ref from the main branch. - * @param filepath Path to retrieve the config content. - * @return Config content as String. + * + * @param repository Repository ref + * @param commit Last commit ref from the main branch + * @param filepath Path to retrieve the config content + * @return Config content as String */ private String readFile(final Repository repository, final RevCommit commit, final String filepath) throws IOException { final TreeWalk walk = TreeWalk.forPath(repository, filepath, commit.getTree()); diff --git a/src/test/java/io/playrconf/provider/GitProviderTest.java b/src/test/java/io/playrconf/provider/GitProviderTest.java index c6fafbf..0f2970f 100644 --- a/src/test/java/io/playrconf/provider/GitProviderTest.java +++ b/src/test/java/io/playrconf/provider/GitProviderTest.java @@ -39,18 +39,20 @@ /** * GitProviderTest. - * + *

* Default environment variables: - * 1. REMOTECONF_GIT_BRANCH - * 2. REMOTECONF_GIT_FILEPATH - * + * 1. REMOTECONF_GIT_BRANCH + * 2. REMOTECONF_GIT_FILEPATH + *

+ *

* Required environment variables: - * 1. For none mode: - * a) REMOTECONF_GIT_URI - * 2. For user mode: - * a) REMOTECONF_GIT_USER_URI - * b) REMOTECONF_GIT_USER_LOGIN - * c) REMOTECONF_GIT_USER_PASSWORD + * 1. For none mode: + * a) REMOTECONF_GIT_URI + * 2. For user mode: + * a) REMOTECONF_GIT_USER_URI + * b) REMOTECONF_GIT_USER_LOGIN + * c) REMOTECONF_GIT_USER_PASSWORD + *

* * @author Felipe Boenzi * @since 20.10.29