Skip to content

Commit

Permalink
Merge pull request #84 from yodamad/dev
Browse files Browse the repository at this point in the history
v1.17.1
  • Loading branch information
yodamad authored Jun 24, 2019
2 parents 6bd2308 + 1cedb98 commit 5029214
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 115 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ Desktop.ini

src/main/resources/.h2.server.properties
yarn.lock
!external/bfg-custom.jar
90 changes: 2 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,6 @@

This application helps you to migrate from SVN to Gitlab.

This application was generated using JHipster 5.4.2, you can find documentation and help at [jhipster](https://www.jhipster.tech/documentation-archive/v5.4.2).

## Development

To install dependences : `yarn install`

To run UI : `yarn start`

To run server : `mvn spring-boot:run`

If everything ok, you should be able to access site throught `http://localhost:9000`

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/home.png)

## Use cases
### Migration initialisation

Just click on ![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/start_migration.png)

You have to check several information before starting the migration :

your gitlab account and group

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/check_gitlab.png)

*You can override gitlab URL & token if necessary*

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/override_gitlab.png)

your svn repository

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/check_svn.png)

*You can override SVN URL, user & password if necessary*

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/override_svn.png)

Then, choose between which project(s) to migration and migrate to complete repository if trunk, branches & tags are at root directory

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/choose_svn.png)

You can choose to keep history or not, only on trunk or for every branch

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/history_options.png)

If some static mappings are configured, you can enable/disable which on to apply

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/mappings.png)

Or add a custom mapping

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/custom_mapping.png)

Optionnaly, add some cleaning options based on files size or/and extensions

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/cleaning_options.png)

Or add a custom extension

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/custom_extension.png)

Check the summary

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/summary.png)

You're good to go !!

### Migration check

It is possible to check status of migrations and associated details.

Just click on ![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/check_migration.png)

Then search migrations with your gitlab account name, svn group or svn project

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/search_migration.png)

The migrations founded are display

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/migrations_list.png)

You can check details of a migration by clicking on ![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/view.png)

You can also retry a failed migration by clicking on ![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/retry.png)

You are routed to migration details page resuming migration and steps

![alt text](https://raw.githubusercontent.com/yodamad/svn2git/master/github/details.png)
This application was generated using JHipster (5.4.2), you can find documentation and help at [jhipster](https://www.jhipster.tech/documentation-archive/v5.4.2).

All documentation can be find in [wiki](https://github.com/yodamad/svn2git/wiki) section
Binary file added external/bfg-custom.jar
Binary file not shown.
22 changes: 6 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>fr.yodamad.svn2git</groupId>
<artifactId>svn-2-git</artifactId>
<version>1.17</version>
<version>1.17.1</version>
<packaging>war</packaging>
<name>Svn 2 GitLab</name>

Expand Down Expand Up @@ -331,13 +331,11 @@
</dependency>
<dependency>
<groupId>com.madgag</groupId>
<artifactId>bfg</artifactId>
<version>1.13.0</version>
<artifactId>bfg</artifactId>
<version>custom</version>
<systemPath>${project.basedir}/external/bfg-custom.jar</systemPath>
<scope>system</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
Expand Down Expand Up @@ -573,6 +571,7 @@
<mainClass>${start-class}</mainClass>
<executable>true</executable>
<fork>true</fork>
<includeSystemScope>true</includeSystemScope>
<!--
Enable the line below to have remote debugging of your application on port 5005
<jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
Expand Down Expand Up @@ -751,9 +750,6 @@
<includes>
<include>WEB-INF/**</include>
</includes>
<excludes>
<exclude>WEB-INF/lib/logback-classic-1.2.3.jar</exclude>
</excludes>
</resource>
</webResources>
</configuration>
Expand Down Expand Up @@ -800,9 +796,6 @@
<includes>
<include>WEB-INF/**</include>
</includes>
<excludes>
<exclude>WEB-INF/lib/logback-classic-1.2.3.jar</exclude>
</excludes>
</resource>
</webResources>
</configuration>
Expand Down Expand Up @@ -852,9 +845,6 @@
<includes>
<include>WEB-INF/**</include>
</includes>
<excludes>
<exclude>WEB-INF/lib/logback-classic-1.2.3.jar</exclude>
</excludes>
</resource>
</webResources>
</configuration>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/fr/yodamad/svn2git/domain/GitlabInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ public class GitlabInfo {

public String url;
public String token;

@Override
public String toString() {
return String.format("Gitlab connection to %s using token %s", url, token);
}
}
3 changes: 2 additions & 1 deletion src/main/java/fr/yodamad/svn2git/service/GitManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

import static fr.yodamad.svn2git.service.util.MigrationConstants.*;
import static fr.yodamad.svn2git.service.util.Shell.execCommand;
import static fr.yodamad.svn2git.service.util.Shell.isWindows;
import static java.lang.String.format;
import static java.nio.file.Files.walk;

Expand Down Expand Up @@ -173,7 +174,7 @@ public void gitSvnClone(WorkUnit workUnit) throws IOException, InterruptedExcept
*/
private static String initCommand(WorkUnit workUnit, String username, String secret) {
return format("%s git svn clone %s %s %s %s %s/%s",
StringUtils.isEmpty(secret) ? "" : format("echo %s |", secret),
StringUtils.isEmpty(secret) ? "" : isWindows ? format("echo(%s|", secret) : format("echo %s |", secret),
StringUtils.isEmpty(username) ? "" : format("--username %s", username),
workUnit.migration.getTrunk() == null ? "" : format("--trunk=%s/trunk", workUnit.migration.getSvnProject()),
workUnit.migration.getBranches() == null ? "" : format("--branches=%s/branches", workUnit.migration.getSvnProject()),
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/fr/yodamad/svn2git/web/rest/GitlabResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public GitlabResource(GitlabAdmin gitlabAdmin,
@Timed
public ResponseEntity<Boolean> checkUser(@PathVariable("username") String userName, @RequestBody GitlabInfo gitlabInfo) {
Optional<User> user = overrideGitlab(gitlabInfo).userApi().getOptionalUser(userName);
GitLabApiException exception = GitLabApi.getOptionalException(user);

if (exception != null) {
LOG.error("Fail to access gitlab", exception.getMessage());
return ResponseEntity.badRequest().build();
}

if (user.isPresent()) {
return ResponseEntity.ok()
Expand Down
17 changes: 7 additions & 10 deletions src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝

${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} ::
:: https://www.jhipster.tech ::${AnsiColor.DEFAULT}
,---. ,--. ,--.
,---. ,--. ,--. ,--,--, '.-. \ ,---. `--' ,-' '-.
( .-' \ `' / | \ .-' .' | .-. | ,--. '-. .-'
.-' `) \ / | || | / '-. ' '-' ' | | | |
`----' `--' `--''--' '-----' .`- / `--' `--'
`---'
${AnsiColor.RED} svn2git ${AnsiColor.DEFAULT} :: Running ${AnsiColor.GREEN} Spring Boot ${AnsiColor.DEFAULT} ${spring-boot.version}

0 comments on commit 5029214

Please sign in to comment.