-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from yodamad/dev
🐳 Dockerize application
- Loading branch information
Showing
7 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM openjdk:11-jre-slim | ||
|
||
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ | ||
JHIPSTER_SLEEP=0 \ | ||
JAVA_OPTS="" | ||
|
||
RUN apt update && \ | ||
apt install -y git git-svn subversion | ||
|
||
COPY target/svn-2-git-1.18.2.jar /usr/svn2git/ | ||
|
||
WORKDIR /usr/svn2git | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "svn-2-git-1.18.2.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM openjdk:8-jre-alpine | ||
FROM openjdk:11-jre-alpine | ||
|
||
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ | ||
JHIPSTER_SLEEP=0 \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,7 @@ public void startMigration(final long migrationId, final boolean retry) { | |
|
||
// 2.2. SVN checkout | ||
gitManager.gitSvnClone(workUnit); | ||
checkGitConfig(workUnit); | ||
|
||
copyRootDirectory(workUnit); | ||
// Migration is now reexecutable in cases where there is a failure | ||
|
@@ -491,14 +492,37 @@ private void logGitConfig(WorkUnit workUnit) throws IOException, InterruptedExce | |
historyMgr.endStep(history, StatusEnum.DONE, null); | ||
} | ||
|
||
private void checkGitConfig(WorkUnit workUnit) throws IOException, InterruptedException { | ||
|
||
MigrationHistory history = historyMgr.startStep(workUnit.migration, StepEnum.GIT_SET_CONFIG, "Log Git Config and origin of config."); | ||
String gitCommand = "git config user.name"; | ||
//String workDir = format("%s/%s", workUnit.directory, workUnit.migration.getSvnProject()); | ||
try { | ||
execCommand(workUnit.commandManager, workUnit.directory, gitCommand); | ||
} catch (RuntimeException rEx) { | ||
LOG.info("Git user.email and user.name not set, use default values based on gitlab user set in UI"); | ||
gitCommand = format("git config user.email %[email protected]", workUnit.migration.getUser()); | ||
execCommand(workUnit.commandManager, workUnit.directory, gitCommand); | ||
gitCommand = format("git config user.name %s", workUnit.migration.getUser()); | ||
execCommand(workUnit.commandManager, workUnit.directory, gitCommand); | ||
} finally { | ||
historyMgr.endStep(history, StatusEnum.DONE, null); | ||
} | ||
} | ||
|
||
private void logUlimit(WorkUnit workUnit) throws IOException, InterruptedException { | ||
|
||
// On linux servers trace what ulimit value is | ||
if (!isWindows) { | ||
MigrationHistory history = historyMgr.startStep(workUnit.migration, StepEnum.ULIMIT, "Show Ulimit -u value."); | ||
String command = "ulimit -u"; | ||
execCommand(workUnit.commandManager, workUnit.directory, command); | ||
historyMgr.endStep(history, StatusEnum.DONE, null); | ||
try { | ||
String command = "ulimit -u"; | ||
execCommand(workUnit.commandManager, workUnit.directory, command); | ||
} catch (Exception exc) { | ||
// Ignore exception as it's just info displayed | ||
} finally { | ||
historyMgr.endStep(history, StatusEnum.DONE, null); | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters