Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
b62a07c0
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b62a07c0
编写于
4月 14, 2015
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into JENKINS-26781 and fixing @since TODO.
上级
37167d5f
e26d6b79
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
102 addition
and
70 deletion
+102
-70
changelog.html
changelog.html
+5
-2
cli/pom.xml
cli/pom.xml
+1
-1
core/pom.xml
core/pom.xml
+6
-1
core/src/main/java/hudson/FilePath.java
core/src/main/java/hudson/FilePath.java
+9
-23
core/src/main/java/hudson/model/Descriptor.java
core/src/main/java/hudson/model/Descriptor.java
+2
-2
core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java
...main/java/hudson/org/apache/tools/tar/TarInputStream.java
+2
-1
core/src/main/java/hudson/org/apache/tools/tar/TarOutputStream.java
...ain/java/hudson/org/apache/tools/tar/TarOutputStream.java
+3
-0
core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java
.../src/main/java/hudson/tools/DownloadFromUrlInstaller.java
+1
-0
core/src/main/java/hudson/util/io/TarArchiver.java
core/src/main/java/hudson/util/io/TarArchiver.java
+15
-31
core/src/main/java/jenkins/AgentProtocol.java
core/src/main/java/jenkins/AgentProtocol.java
+1
-2
core/src/test/java/hudson/FilePathTest.java
core/src/test/java/hudson/FilePathTest.java
+50
-0
plugins/pom.xml
plugins/pom.xml
+4
-4
pom.xml
pom.xml
+1
-1
test/pom.xml
test/pom.xml
+1
-1
war/pom.xml
war/pom.xml
+1
-1
未找到文件。
changelog.html
浏览文件 @
b62a07c0
...
...
@@ -54,6 +54,11 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
>
</ul
>
</div>
<!--=TRUNK-END=-->
<h3><a
name=
v1.609
>
What's new in 1.609
</a>
(2015/04/12)
</h3>
<ul
class=
image
>
<li
class=
bug
>
When concurrent builds are enabled, artifact retention policy may delete artifact being
...
...
@@ -62,9 +67,7 @@ Upcoming changes</a>
<li
class=
bug
>
Documentation for $BUILD_ID did not reflect current reality
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-26520"
>
issue 26520
</a>
)
<li
class=
>
</ul>
</div>
<!--=TRUNK-END=-->
<h3><a
name=
v1.608
>
What's new in 1.608
</a>
(2015/04/05)
</h3>
<ul
class=
image
>
<li
class=
bug
>
...
...
cli/pom.xml
浏览文件 @
b62a07c0
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
pom
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
</parent>
<artifactId>
cli
</artifactId>
...
...
core/pom.xml
浏览文件 @
b62a07c0
...
...
@@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
pom
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
</parent>
<artifactId>
jenkins-core
</artifactId>
...
...
@@ -276,6 +276,11 @@ THE SOFTWARE.
<artifactId>
commons-beanutils
</artifactId>
<version>
1.8.3
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-compress
</artifactId>
<version>
1.9
</version>
</dependency>
<dependency>
<groupId>
javax.mail
</groupId>
<artifactId>
mail
</artifactId>
...
...
core/src/main/java/hudson/FilePath.java
浏览文件 @
b62a07c0
...
...
@@ -33,7 +33,6 @@ import hudson.model.AbstractProject;
import
hudson.model.Computer
;
import
hudson.model.Item
;
import
hudson.model.TaskListener
;
import
hudson.org.apache.tools.tar.TarInputStream
;
import
hudson.os.PosixAPI
;
import
hudson.os.PosixException
;
import
hudson.remoting.Callable
;
...
...
@@ -70,7 +69,6 @@ import org.apache.commons.io.input.CountingInputStream;
import
org.apache.tools.ant.DirectoryScanner
;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.types.FileSet
;
import
org.apache.tools.tar.TarEntry
;
import
org.apache.tools.zip.ZipEntry
;
import
org.apache.tools.zip.ZipFile
;
import
org.kohsuke.stapler.Stapler
;
...
...
@@ -120,6 +118,8 @@ import static hudson.Util.*;
import
javax.annotation.Nonnull
;
import
javax.annotation.Nullable
;
import
jenkins.security.MasterToSlaveCallable
;
import
org.apache.commons.compress.archivers.tar.TarArchiveEntry
;
import
org.apache.commons.compress.archivers.tar.TarArchiveInputStream
;
import
org.jenkinsci.remoting.RoleChecker
;
import
org.jenkinsci.remoting.RoleSensitive
;
...
...
@@ -2266,12 +2266,15 @@ public final class FilePath implements Serializable {
/**
* Reads from a tar stream and stores obtained files to the base dir.
* @since TODO supports large files > 10 GB, migration to commons-compress
*/
private
void
readFromTar
(
String
name
,
File
baseDir
,
InputStream
in
)
throws
IOException
{
TarInputStream
t
=
new
TarInputStream
(
in
);
TarArchiveInputStream
t
=
new
TarArchiveInputStream
(
in
);
// TarInputStream t = new TarInputStream(in);
try
{
TarEntry
te
;
while
((
te
=
t
.
getNextEntry
())
!=
null
)
{
Tar
Archive
Entry
te
;
while
((
te
=
t
.
getNext
Tar
Entry
())
!=
null
)
{
File
f
=
new
File
(
baseDir
,
te
.
getName
());
if
(
te
.
isDirectory
())
{
mkdirs
(
f
);
...
...
@@ -2280,8 +2283,7 @@ public final class FilePath implements Serializable {
if
(
parent
!=
null
)
mkdirs
(
parent
);
writing
(
f
);
byte
linkFlag
=
(
Byte
)
LINKFLAG_FIELD
.
get
(
te
);
if
(
linkFlag
==
TarEntry
.
LF_SYMLINK
)
{
if
(
te
.
isSymbolicLink
())
{
new
FilePath
(
f
).
symlinkTo
(
te
.
getLinkName
(),
TaskListener
.
NULL
);
}
else
{
IOUtils
.
copy
(
t
,
f
);
...
...
@@ -2298,8 +2300,6 @@ public final class FilePath implements Serializable {
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
// process this later
throw
new
IOException
(
"Failed to extract "
+
name
,
e
);
}
catch
(
IllegalAccessException
e
)
{
throw
new
IOException
(
"Failed to extract "
+
name
,
e
);
}
finally
{
t
.
close
();
}
...
...
@@ -2722,20 +2722,6 @@ public final class FilePath implements Serializable {
}
};
private
static
final
Field
LINKFLAG_FIELD
=
getTarEntryLinkFlagField
();
private
static
Field
getTarEntryLinkFlagField
()
{
try
{
Field
f
=
TarEntry
.
class
.
getDeclaredField
(
"linkFlag"
);
f
.
setAccessible
(
true
);
return
f
;
}
catch
(
SecurityException
e
)
{
throw
new
AssertionError
(
e
);
}
catch
(
NoSuchFieldException
e
)
{
throw
new
AssertionError
(
e
);
}
}
/**
* Gets the {@link FilePath} representation of the "~" directory
* (User's home directory in the Unix sense) of the given channel.
...
...
core/src/main/java/hudson/model/Descriptor.java
浏览文件 @
b62a07c0
...
...
@@ -933,7 +933,7 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
/**
* Finds a descriptor from a collection by its ID.
* @param id should match {@link #getId}
* @since
TODO
* @since
1.610
*/
public
static
@CheckForNull
<
T
extends
Descriptor
>
T
findById
(
Collection
<?
extends
T
>
list
,
String
id
)
{
for
(
T
d
:
list
)
{
...
...
@@ -958,7 +958,7 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
/**
* Finds a descriptor from a collection by the class name of the {@link Describable} it describes.
* @param className should match {@link Class#getName} of a {@link #clazz}
* @since
TODO
* @since
1.610
*/
public
static
@CheckForNull
<
T
extends
Descriptor
>
T
findByDescribableClassName
(
Collection
<?
extends
T
>
list
,
String
className
)
{
for
(
T
d
:
list
)
{
...
...
core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java
浏览文件 @
b62a07c0
...
...
@@ -37,8 +37,9 @@ import java.io.ByteArrayOutputStream;
* methods are provided to position at each successive entry in
* the archive, and the read each entry as a normal input stream
* using read().
*
*
@deprecated Use {@link org.apache.commons.compress.archivers.tar.TarArchiveInputStream} instead
*/
@Deprecated
public
class
TarInputStream
extends
FilterInputStream
{
// CheckStyle:VisibilityModifier OFF - bc
...
...
core/src/main/java/hudson/org/apache/tools/tar/TarOutputStream.java
浏览文件 @
b62a07c0
...
...
@@ -35,8 +35,11 @@ import java.io.IOException;
* The TarOutputStream writes a UNIX tar archive as an OutputStream.
* Methods are provided to put entries, and then write their contents
* by writing to this stream using write().
*
* @deprecated Use {@link org.apache.commons.compress.archivers.tar.TarArchiveOutputStream} instead
*
*/
@Deprecated
public
class
TarOutputStream
extends
FilterOutputStream
{
/** Fail if a long file name is required in the archive. */
public
static
final
int
LONGFILE_ERROR
=
0
;
...
...
core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java
浏览文件 @
b62a07c0
...
...
@@ -129,6 +129,7 @@ public abstract class DownloadFromUrlInstaller extends ToolInstaller {
* This ID needs to be unique, and needs to match the ID token in the JSON update file.
* <p>
* By default we use the fully-qualified class name of the {@link DownloadFromUrlInstaller} subtype.
* @since 1.610
*/
public
String
getDownloadableId
()
{
return
clazz
.
getName
().
replace
(
'$'
,
'.'
);
...
...
core/src/main/java/hudson/util/io/TarArchiver.java
浏览文件 @
b62a07c0
...
...
@@ -37,6 +37,8 @@ import java.io.FileInputStream;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.lang.reflect.Field
;
import
org.apache.commons.compress.archivers.tar.TarArchiveEntry
;
import
org.apache.commons.compress.archivers.tar.TarArchiveOutputStream
;
import
static
org
.
apache
.
tools
.
tar
.
TarConstants
.
LF_SYMLINK
;
...
...
@@ -47,10 +49,10 @@ import static org.apache.tools.tar.TarConstants.LF_SYMLINK;
*/
final
class
TarArchiver
extends
Archiver
{
private
final
byte
[]
buf
=
new
byte
[
8192
];
private
final
TarOutputStream
tar
;
private
final
Tar
Archive
OutputStream
tar
;
TarArchiver
(
OutputStream
out
)
{
tar
=
new
TarOutputStream
(
new
BufferedOutputStream
(
out
)
{
tar
=
new
Tar
Archive
OutputStream
(
new
BufferedOutputStream
(
out
)
{
// TarOutputStream uses TarBuffer internally,
// which flushes the stream for each block. this creates unnecessary
// data stream fragmentation, and flush request to a remote, which slows things down.
...
...
@@ -58,13 +60,14 @@ final class TarArchiver extends Archiver {
public
void
flush
()
throws
IOException
{
// so don't do anything in flush
}
});
tar
.
setLongFileMode
(
TarOutputStream
.
LONGFILE_GNU
);
});
tar
.
setBigNumberMode
(
TarArchiveOutputStream
.
BIGNUMBER_STAR
);
tar
.
setLongFileMode
(
TarArchiveOutputStream
.
LONGFILE_GNU
);
}
@Override
public
void
visitSymlink
(
File
link
,
String
target
,
String
relativePath
)
throws
IOException
{
Tar
Entry
e
=
new
Tar
Entry
(
relativePath
,
LF_SYMLINK
);
Tar
ArchiveEntry
e
=
new
TarArchive
Entry
(
relativePath
,
LF_SYMLINK
);
try
{
int
mode
=
IOUtils
.
mode
(
link
);
if
(
mode
!=
-
1
)
{
...
...
@@ -73,16 +76,11 @@ final class TarArchiver extends Archiver {
}
catch
(
PosixException
x
)
{
// ignore
}
e
.
setLinkName
(
target
);
try
{
StringBuffer
linkName
=
(
StringBuffer
)
LINKNAME_FIELD
.
get
(
e
);
linkName
.
setLength
(
0
);
linkName
.
append
(
target
);
}
catch
(
IllegalAccessException
x
)
{
throw
new
IOException
(
"Failed to set linkName"
,
x
);
}
tar
.
putNextEntry
(
e
);
tar
.
putArchiveEntry
(
e
);
tar
.
closeArchiveEntry
();
entriesWritten
++;
}
...
...
@@ -97,14 +95,14 @@ final class TarArchiver extends Archiver {
if
(
file
.
isDirectory
())
relativePath
+=
'/'
;
Tar
Entry
te
=
new
Tar
Entry
(
relativePath
);
Tar
ArchiveEntry
te
=
new
TarArchive
Entry
(
relativePath
);
int
mode
=
IOUtils
.
mode
(
file
);
if
(
mode
!=-
1
)
te
.
setMode
(
mode
);
te
.
setModTime
(
file
.
lastModified
());
if
(!
file
.
isDirectory
())
te
.
setSize
(
file
.
length
());
tar
.
put
Next
Entry
(
te
);
tar
.
put
Archive
Entry
(
te
);
if
(!
file
.
isDirectory
())
{
FileInputStream
in
=
new
FileInputStream
(
file
);
...
...
@@ -117,25 +115,11 @@ final class TarArchiver extends Archiver {
}
}
tar
.
closeEntry
();
tar
.
close
Archive
Entry
();
entriesWritten
++;
}
public
void
close
()
throws
IOException
{
tar
.
close
();
}
private
static
final
Field
LINKNAME_FIELD
=
getTarEntryLinkNameField
();
private
static
Field
getTarEntryLinkNameField
()
{
try
{
Field
f
=
TarEntry
.
class
.
getDeclaredField
(
"linkName"
);
f
.
setAccessible
(
true
);
return
f
;
}
catch
(
SecurityException
e
)
{
throw
new
AssertionError
(
e
);
}
catch
(
NoSuchFieldException
e
)
{
throw
new
AssertionError
(
e
);
}
}
}
core/src/main/java/jenkins/AgentProtocol.java
浏览文件 @
b62a07c0
...
...
@@ -4,7 +4,6 @@ import hudson.Extension;
import
hudson.ExtensionList
;
import
hudson.ExtensionPoint
;
import
hudson.TcpSlaveAgentListener
;
import
hudson.model.AperiodicWork
;
import
jenkins.model.Jenkins
;
import
java.io.IOException
;
...
...
@@ -40,7 +39,7 @@ public abstract class AgentProtocol implements ExtensionPoint {
public
abstract
void
handle
(
Socket
socket
)
throws
IOException
,
InterruptedException
;
/**
* Returns all the registered {@link A
periodicWork
}s.
* Returns all the registered {@link A
gentProtocol
}s.
*/
public
static
ExtensionList
<
AgentProtocol
>
all
()
{
return
ExtensionList
.
lookup
(
AgentProtocol
.
class
);
...
...
core/src/test/java/hudson/FilePathTest.java
浏览文件 @
b62a07c0
...
...
@@ -35,6 +35,7 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.RandomAccessFile
;
import
java.net.ConnectException
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
...
...
@@ -56,6 +57,8 @@ import org.apache.commons.io.output.NullOutputStream;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.taskdefs.Chmod
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
junit
.
Assume
.
assumeTrue
;
import
org.junit.Ignore
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.rules.TemporaryFolder
;
...
...
@@ -325,6 +328,53 @@ public class FilePathTest {
FileUtils
.
touch
(
building
);
return
new
FilePath
(
building
);
}
/**
* Performs round-trip archiving for Tar handling methods.
* @throws Exception test failure
*/
@Test
public
void
compressTarUntarRoundTrip
()
throws
Exception
{
checkTarUntarRoundTrip
(
"compressTarUntarRoundTrip_zero"
,
0
);
checkTarUntarRoundTrip
(
"compressTarUntarRoundTrip_small"
,
100
);
checkTarUntarRoundTrip
(
"compressTarUntarRoundTrip_medium"
,
50000
);
}
/**
* Checks that big files (>8GB) can be archived and then unpacked.
* This test is disabled by default due the impact on RAM.
* The actual file size limit is 8589934591 bytes.
* @throws Exception test failure
*/
@Issue
(
"JENKINS-10629"
)
@Ignore
@Test
public
void
archiveBigFile
()
throws
Exception
{
final
long
largeFileSize
=
9000000000L
;
// >8589934591 bytes
final
String
filePrefix
=
"JENKINS-10629"
;
checkTarUntarRoundTrip
(
filePrefix
,
largeFileSize
);
}
private
void
checkTarUntarRoundTrip
(
String
filePrefix
,
long
fileSize
)
throws
Exception
{
final
File
tmpDir
=
temp
.
newFolder
(
filePrefix
);
final
File
tempFile
=
new
File
(
tmpDir
,
filePrefix
+
".log"
);
RandomAccessFile
file
=
new
RandomAccessFile
(
tempFile
,
"rw"
);
final
File
tarFile
=
new
File
(
tmpDir
,
filePrefix
+
".tar"
);
file
.
setLength
(
fileSize
);
assumeTrue
(
fileSize
==
file
.
length
());
file
.
close
();
// Compress archive
final
FilePath
tmpDirPath
=
new
FilePath
(
tmpDir
);
int
tar
=
tmpDirPath
.
tar
(
new
FileOutputStream
(
tarFile
),
tempFile
.
getName
());
assertEquals
(
"One file should have been compressed"
,
1
,
tar
);
// Decompress
FilePath
outDir
=
new
FilePath
(
temp
.
newFolder
(
filePrefix
+
"_out"
));
final
FilePath
outFile
=
outDir
.
child
(
tempFile
.
getName
());
tmpDirPath
.
child
(
filePrefix
+
".tar"
).
untar
(
outDir
,
TarCompression
.
NONE
);
assertEquals
(
"Result file after the roundtrip differs from the initial file"
,
new
FilePath
(
tempFile
).
digest
(),
outFile
.
digest
());
}
@Test
public
void
list
()
throws
Exception
{
File
baseDir
=
temp
.
getRoot
();
...
...
plugins/pom.xml
浏览文件 @
b62a07c0
...
...
@@ -12,7 +12,7 @@
<groupId>
org.jenkins-ci.plugins
</groupId>
<artifactId>
plugin
</artifactId>
<name>
Jenkins plugin POM
</name>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<!--
...
...
@@ -41,19 +41,19 @@
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
jenkins-war
</artifactId>
<type>
war
</type>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
jenkins-core
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
jenkins-test-harness
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
<scope>
test
</scope>
</dependency>
<!--
...
...
pom.xml
浏览文件 @
b62a07c0
...
...
@@ -33,7 +33,7 @@ THE SOFTWARE.
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
pom
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<name>
Jenkins main module
</name>
...
...
test/pom.xml
浏览文件 @
b62a07c0
...
...
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
pom
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
</parent>
<artifactId>
jenkins-test-harness
</artifactId>
...
...
war/pom.xml
浏览文件 @
b62a07c0
...
...
@@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>
org.jenkins-ci.main
</groupId>
<artifactId>
pom
</artifactId>
<version>
1.6
09
-SNAPSHOT
</version>
<version>
1.6
10
-SNAPSHOT
</version>
</parent>
<artifactId>
jenkins-war
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录