提交 938a5802 编写于 作者: J Jesse Glick

Merge branch 'master' of github.com:jenkinsci/jenkins

......@@ -61,6 +61,8 @@ Upcoming changes</a>
<li class=bug>
Preview function for textareas using Jenkins markup did not work when CSRF protection was enabled.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17085">issue 17085</a>)
<li class=rfe>
Improved the duration browsers cache static resources.
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -42,7 +42,7 @@ THE SOFTWARE.
<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.199</stapler.version>
<stapler.version>1.204</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
</properties>
......@@ -199,7 +199,7 @@ THE SOFTWARE.
<dependency><!-- until we get this version through Stapler -->
<groupId>org.kohsuke.stapler</groupId>
<artifactId>json-lib</artifactId>
<version>2.1-rev7</version>
<version>2.4-jenkins-1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
......
......@@ -58,6 +58,8 @@ import java.util.Set;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.slaves.WorkspaceLocator;
import org.apache.commons.io.IOUtils;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.HttpResponse;
......@@ -267,6 +269,13 @@ public abstract class Slave extends Node implements Serializable {
}
public FilePath getWorkspaceFor(TopLevelItem item) {
for (WorkspaceLocator l : WorkspaceLocator.all()) {
FilePath workspace = l.locate(item, this);
if (workspace != null) {
return workspace;
}
}
FilePath r = getWorkspaceRoot();
if(r==null) return null; // offline
return r.child(item.getFullName());
......
......@@ -166,7 +166,11 @@ public class UpdateSite {
String uncleanJson = IOUtils.toString(is,"UTF-8");
int jsonStart = uncleanJson.indexOf("{\"");
if (jsonStart >= 0) {
return updateData(uncleanJson.substring(jsonStart), signatureCheck);
uncleanJson = uncleanJson.substring(jsonStart);
int end = uncleanJson.lastIndexOf('}');
if (end>0)
uncleanJson = uncleanJson.substring(0,end+1);
return updateData(uncleanJson, signatureCheck);
} else {
throw new IOException("Could not find json in content of " +
"update center from url: "+src.toExternalForm());
......
......@@ -197,6 +197,7 @@ import jenkins.InitReactorRunner;
import jenkins.model.ProjectNamingStrategy.DefaultProjectNamingStrategy;
import jenkins.security.ConfidentialKey;
import jenkins.security.ConfidentialStore;
import jenkins.slaves.WorkspaceLocator;
import jenkins.util.io.FileBoolean;
import net.sf.json.JSONObject;
import org.acegisecurity.AccessDeniedException;
......@@ -793,7 +794,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
// JSON binding needs to be able to see all the classes from all the plugins
WebApp.get(servletContext).setClassLoader(pluginManager.uberClassLoader);
adjuncts = new AdjunctManager(servletContext, pluginManager.uberClassLoader,"adjuncts/"+SESSION_HASH);
adjuncts = new AdjunctManager(servletContext, pluginManager.uberClassLoader,"adjuncts/"+SESSION_HASH, TimeUnit2.DAYS.toMillis(365));
// initialization consists of ...
executeReactor( is,
......@@ -1925,6 +1926,13 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
}
public FilePath getWorkspaceFor(TopLevelItem item) {
for (WorkspaceLocator l : WorkspaceLocator.all()) {
FilePath workspace = l.locate(item, this);
if (workspace != null) {
return workspace;
}
}
return new FilePath(expandVariablesForDirectory(workspaceDir, item));
}
......
package jenkins.slaves;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.FilePath;
import hudson.model.Node;
import hudson.model.TopLevelItem;
import jenkins.model.Jenkins;
/**
* Allow extensions to override workspace locations
* on given slaves or projects.
*
* @author ryan.campbell@gmail.com
* @since 1.501
*/
public abstract class WorkspaceLocator implements ExtensionPoint {
/**
* Allows extensions to customize the workspace path. The first non-null response
* will determine the path to the workspace on that slave.
*
* @param item The toplevel item
* @param slave The slave
* @return The absolute FilePath to the workspace on the slave.
* Will be created if it doesn't exist.
*
*/
public abstract FilePath locate(TopLevelItem item, Node node);
/**
* All registered {@link WorkspaceLocator}s.
*/
public static ExtensionList<WorkspaceLocator> all() {
return Jenkins.getInstance().getExtensionList(WorkspaceLocator.class);
}
}
......@@ -35,3 +35,8 @@ rekeySuccessful=\
rekeyHadProblems=\
\u91d1\u9470\u91cd\u5957\u5b8c\u6210\uff0c\u4f46\u662f\u9047\u5230\u4e00\u4e9b\u554f\u984c\u3002<a href="{0}">\u8acb\u67e5\u770b\u8a18\u9304</a>\u3002
Re-key\ in\ background\ now=\u99ac\u4e0a\u5728\u80cc\u666f\u91cd\u5957\u91d1\u9470
Re-keying\ currently\ scheduled\ during\ the\ next\ startup=\u5df2\u7d93\u6392\u5b9a\u5728\u4e0b\u6b21\u555f\u52d5\u5f8c\u91cd\u5957\u91d1\u9470
Schedule\ a\ re-key\ during\ the\ next\ startup=\u6392\u7a0b\u5728\u4e0b\u6b21\u555f\u52d5\u5f8c\u91cd\u5957\u91d1\u9470
Dismiss\ this\ message=\u5ffd\u7565\u9019\u500b\u8a0a\u606f
<div>
管理要保留的建置記錄 (包含畫面輸出、建置成品等) 數,控制 Jenkins 的磁碟使用量
管理要保留的建置記錄 (包含畫面輸出、建置成品等) 數,控制 Jenkins 的磁碟使用量。
Jenkins 提供兩種準則:
<ol>
<li>
依新舊狀況處理。您可以要 Jenkins 刪除超過指定時間 (例如 7 天) 前的記錄。
依新舊狀況處理。您可以要 Jenkins 刪除指定時間 (例如 7 天) 前的記錄。
<li>
依次數處理。您可以讓 Jenkins 只保留最近的 N 筆建置記錄。如果開始新的建置後,最早的記錄就會被刪掉。
</ol>
Jenkins 也允許您將單獨的建置標為「永久保存這次建置」,將特定幾次重要建置排除在自動刪除清單外
Jenkins 也允許您將某些建置標為「永久保存」,讓特定幾次重要建置不會被自動刪除
最後一次穩定建置及最後一次成功建置也會一直保留住。
</div>
\ No newline at end of file
</div>
......@@ -9,5 +9,5 @@
(不建議) 修改 <code>jenkins.war</code> (或解開到您 Web Container 裡的複本) 裡的 web.xml。
</ol>
Jenkins 執行時無法修改這個值。
這個項目主要是譹您確認您的設定真的有生效
這個項目主要是讓您確認設定正確與否
</div>
......@@ -3,21 +3,22 @@
<dl>
<dt><b>
盡可能使用這個 Slave
盡可能使用這個節點
</b></dt>
<dd>
預設值,也是最常用的設定。
這個模式下,Jenkins 會不受限制的使用 Slave。一旦有建置作業可以在這個 Slave 上完成,Jenkins 就會用它。
這個模式下,Jenkins 會不受拘束的使用 Slave。一旦有建置作業可以在這個 Slave 上完成,Jenkins 就會用它。
</dd>
<dt><b>
將機器保留給限定的作業
只保留給限定節點的作業
</b></dt>
<dd>
這個模式下,Jenkins 只會在這部機器上建置那些指定要在這裡跑的那些專案。
這個模式下,Jenkins 只會在這部機器上建置那些明確指定只能在這裡跑的專案。
讓 Slave 保留給特定種類的作業。例如讓 Jenkins 持續執行效能測試。
您還可以同時將執行程式數設成 1,這樣一次就只執行一項效能測試,這個執行程式也不會被能在別的 Slave 建置的作業擋到。
將節點保留給特定種類的作業。
例如讓 Jenkins 持續執行效能測試,您還可以同時將執行程式數設成 1,一次只執行一項效能測試。
這個執行程式也不會因為要執行能在別的節點建置的作業而塞住。
</dd>
</dl>
</div>
\ No newline at end of file
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册