Skip to content

The Unified and Autonomous Development Platform

Add docker file to build server build environment. Remove chinese characters in test case

Robin Shen7b86299ec60b
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..cc006ccf6f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,4 @@
+# Build the docker image with necessary tools to build onedev server docker image
+FROM ubuntu:18.04
+# Install maven in a separate command as otherwise its dependency OpenJDK 11 will be installed
+RUN apt-get update && apt-get install -y git openjdk-8-jdk-headless && apt-get install -y maven
diff --git a/server-core/src/test/java/io/onedev/server/git/command/LogCommandTest.java b/server-core/src/test/java/io/onedev/server/git/command/LogCommandTest.java
index 993659af90..527ee6064c 100644
--- a/server-core/src/test/java/io/onedev/server/git/command/LogCommandTest.java
+++ b/server-core/src/test/java/io/onedev/server/git/command/LogCommandTest.java
@@ -18,7 +18,7 @@ public class LogCommandTest extends AbstractGitTest {
@Test
public void test() throws Exception {
- addFile("测试文件", ""
+ addFile("testfile", ""
+ "1st line\n"
+ "2nd line\n"
+ "3rd line\n"
@@ -28,7 +28,7 @@ public class LogCommandTest extends AbstractGitTest {
+ "7th line\n"
+ "8th line\n"
+ "9th line\n");
- addFile("另一个 测试文件", ""
+ addFile("another testfile", ""
+ "1st line\n"
+ "2nd line\n"
+ "3rd line\n"
@@ -38,9 +38,9 @@ public class LogCommandTest extends AbstractGitTest {
+ "7th line\n"
+ "8th line\n"
+ "9th line\n");
- commit("初始commit\n\nfirst line\nsecond line");
- rm("测试文件");
- addFile("改名后 测试文件", ""
+ commit("initial commit\n\nfirst line\nsecond line");
+ rm("testfile");
+ addFile("renamed testfile", ""
+ "1st line\n"
+ "2nd line\n"
+ "3rd line\n"
@@ -50,7 +50,7 @@ public class LogCommandTest extends AbstractGitTest {
+ "7th line\n"
+ "8th line\n"
+ "9th line\n");
- addFile("另一个 测试文件", ""
+ addFile("another testfile", ""
+ "1st line\n"
+ "2nd line\n"
+ "3rd line\n"
@@ -59,7 +59,7 @@ public class LogCommandTest extends AbstractGitTest {
+ "7th line\n"
+ "8th line\n"
+ "9th line\n");
- addFile("第三个 测试文件", ""
+ addFile("3rd testfile", ""
+ "1st line\n"
+ "2nd line\n"
+ "3rd line\n"
@@ -68,7 +68,7 @@ public class LogCommandTest extends AbstractGitTest {
+ "7th line\n"
+ "8th line\n"
+ "9th line\n");
- commit("第二个commit\n\nfirst line\n\nsecond line\nthird line\n");
+ commit("second commit\n\nfirst line\n\nsecond line\nthird line\n");
List<GitCommit> commits = new ArrayList<>();
@@ -86,16 +86,16 @@ public class LogCommandTest extends AbstractGitTest {
assertEquals(2, commits.size());
GitCommit commit1 = commits.get(1);
- assertEquals("初始commit", commit1.getSubject());
+ assertEquals("initial commit", commit1.getSubject());
assertEquals("first line\nsecond line", commit1.getBody());
GitCommit commit2 = commits.get(0);
assertEquals(3, commit2.getFileChanges().size());
- assertEquals("另一个 测试文件", commit2.getFileChanges().get(0).getNewPath());
- assertEquals("改名后 测试文件", commit2.getFileChanges().get(1).getNewPath());
- assertEquals("测试文件", commit2.getFileChanges().get(1).getOldPath());
- assertEquals("第三个 测试文件", commit2.getFileChanges().get(2).getNewPath());
- assertEquals("第二个commit", commit2.getSubject());
+ assertEquals("3rd testfile", commit2.getFileChanges().get(0).getNewPath());
+ assertEquals("another testfile", commit2.getFileChanges().get(1).getNewPath());
+ assertEquals("another testfile", commit2.getFileChanges().get(1).getOldPath());
+ assertEquals("renamed testfile", commit2.getFileChanges().get(2).getNewPath());
+ assertEquals("second commit", commit2.getSubject());
assertEquals("first line\n\nsecond line\nthird line", commit2.getBody());
commits.clear();
@@ -112,15 +112,15 @@ public class LogCommandTest extends AbstractGitTest {
GitCommit commit = commits.get(0);
assertEquals(3, commit.getFileChanges().size());
- assertEquals("另一个 测试文件", commit.getFileChanges().get(0).getNewPath());
- assertEquals(0, commit.getFileChanges().get(0).getAdditions());
- assertEquals(1, commit.getFileChanges().get(0).getDeletions());
+ assertEquals("3rd testfile", commit.getFileChanges().get(0).getNewPath());
+ assertEquals(8, commit.getFileChanges().get(0).getAdditions());
+ assertEquals(0, commit.getFileChanges().get(0).getDeletions());
- assertEquals("改名后 测试文件", commit.getFileChanges().get(1).getNewPath());
- assertEquals("测试文件", commit.getFileChanges().get(1).getOldPath());
+ assertEquals("another testfile", commit.getFileChanges().get(1).getNewPath());
+ assertEquals(null, commit.getFileChanges().get(1).getOldPath());
- assertEquals("第三个 测试文件", commit.getFileChanges().get(2).getNewPath());
- assertEquals(8, commit.getFileChanges().get(2).getAdditions());
+ assertEquals("renamed testfile", commit.getFileChanges().get(2).getNewPath());
+ assertEquals(0, commit.getFileChanges().get(2).getAdditions());
assertEquals(0, commit.getFileChanges().get(2).getDeletions());
}
diff --git a/server-product/build/docker/Dockerfile b/server-product/build/docker/Dockerfile
index 5977749112..92c2c5fcf3 100644
--- a/server-product/build/docker/Dockerfile
+++ b/server-product/build/docker/Dockerfile
@@ -1,3 +1,4 @@
+# Build the docker image for onedev server
FROM ubuntu:18.04
COPY onedev /app
COPY entrypoint.sh idle.sh /root/bin/