Skip to content

Commit

Permalink
Merge branch '2.0' of github.com:jenkinsci/jenkins into JENKINS-14538
Browse files Browse the repository at this point in the history
Conflicts:
	core/src/main/resources/hudson/model/Computer/sidepanel.jelly
  • Loading branch information
daniel-beck committed Mar 8, 2016
2 parents 4184b5a + ede925c commit 03291cf
Show file tree
Hide file tree
Showing 572 changed files with 4,389 additions and 3,222 deletions.
191 changes: 191 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,191 @@
#!groovy
/*
* This Jenkinsfile is intended to run on https://ci.jenkins-ci.org and may fail anywhere else.
* It makes assumptions about plugins being installed, labels mapping to nodes that can build what is needed, etc.
*
* The required labels are "java" and "docker" - "java" would be any node that can run Java builds. It doesn't need
* to have Java installed, but some setups may have nodes that shouldn't have heavier builds running on them, so we
* make this explicit. "docker" would be any node with docker installed.
*/

// TEST FLAG - to make it easier to turn on/off unit tests for speeding up access to later stuff.
def runTests = true

// Only keep the 10 most recent builds.
properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy: [$class: 'LogRotator',
numToKeepStr: '50',
artifactNumToKeepStr: '20']]])

String packagingBranch = (binding.hasVariable('packagingBranch')) ? packagingBranch : 'master'

timestampedNode('java') {

// First stage is actually checking out the source. Since we're using Multibranch
// currently, we can use "checkout scm".
stage "Checkout source"

checkout scm

// Now run the actual build.
stage "Build and test"

// We're wrapping this in a timeout - if it takes more than 180 minutes, kill it.
timeout(time: 180, unit: 'MINUTES') {
// See below for what this method does - we're passing an arbitrary environment
// variable to it so that JAVA_OPTS and MAVEN_OPTS are set correctly.
withMavenEnv(["JAVA_OPTS=-Xmx1536m -Xms512m -XX:MaxPermSize=1024m",
"MAVEN_OPTS=-Xmx1536m -Xms512m -XX:MaxPermSize=1024m"]) {
// Actually run Maven!
// The -Dmaven.repo.local=${pwd()}/.repository means that Maven will create a
// .repository directory at the root of the build (which it gets from the
// pwd() Workflow call) and use that for the local Maven repository.
sh "mvn -Pdebug -U clean install ${runTests ? '-Dmaven.test.failure.ignore=true -Dconcurrency=1' : '-DskipTests'} -V -B -Dmaven.repo.local=${pwd()}/.repository"
}
}

// Once we've built, archive the artifacts and the test results.
stage "Archive artifacts and test results"

step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar, **/target/*.war, **/target/*.hpi', fingerprint: true])
if (runTests) {
step([$class: 'JUnitResultArchiver', healthScaleFactor: 20.0, testResults: '**/target/surefire-reports/*.xml'])
}
}

def debFileName
def rpmFileName
def suseFileName

// Run the packaging build on a node with the "docker" label.
timestampedNode('docker') {
// First stage here is getting prepped for packaging.
stage "packaging - docker prep"

// Docker environment to build packagings
dir('packaging-docker') {
git branch: packagingBranch, url: 'https://github.com/jenkinsci/packaging.git'
sh 'docker build -t jenkins-packaging-builder:0.1 docker'
}

stage "packaging - actually packaging"
// Working packaging code, separate branch with fixes
dir('packaging') {
deleteDir()

docker.image("jenkins-packaging-builder:0.1").inside("-u root") {
git branch: packagingBranch, url: 'https://github.com/jenkinsci/packaging.git'

try {
// Saw issues with unstashing inside a container, and not sure copy artifact plugin would work here.
// So, simple wget.
sh "wget -q ${currentBuild.absoluteUrl}/artifact/war/target/jenkins.war"
sh "make clean deb rpm suse BRAND=./branding/jenkins.mk BUILDENV=./env/test.mk CREDENTIAL=./credentials/test.mk WAR=jenkins.war"
} catch (Exception e) {
error "Packaging failed: ${e}"
} finally {
// Needed to make sure the output of the build can be deleted by later runs.
// Hackish, yes, but rpm builds as a numeric UID only user fail, so...
sh "chmod -R a+w target || true"
sh "chmod a+w jenkins.war || true"
}
dir("target/debian") {
def debFilesFound = findFiles(glob: "*.deb")
if (debFilesFound.size() > 0) {
debFileName = debFilesFound[0]?.name
}
}

dir("target/rpm") {
def rpmFilesFound = findFiles(glob: "*.rpm")
if (rpmFilesFound.size() > 0) {
rpmFileName = rpmFilesFound[0]?.name
}
}

dir("target/suse") {
def suseFilesFound = findFiles(glob: "*.rpm")
if (suseFilesFound.size() > 0) {
suseFileName = suseFilesFound[0]?.name
}
}

step([$class: 'ArtifactArchiver', artifacts: 'target/**/*', fingerprint: true])

// Fail the build if we didn't find at least one of the packages, meaning they weren't built but
// somehow make didn't error out.
if (debFileName == null || rpmFileName == null || suseFileName == null) {
error "At least one of Debian, RPM or SuSE packages are missing, so failing the build."
}
}

}

}

stage "Package testing"

if (runTests) {
if (!env.BRANCH_NAME.startsWith("PR")) {
// NOTE: As of now, a lot of package tests will fail. See https://issues.jenkins-ci.org/issues/?filter=15257 for
// possible open JIRAs.

// Basic parameters
String artifactName = (binding.hasVariable('artifactName')) ? artifactName : 'jenkins'
String jenkinsPort = (binding.hasVariable('jenkinsPort')) ? jenkinsPort : '8080'

// Set up
String debfile = "artifact://${env.JOB_NAME}/${env.BUILD_NUMBER}#target/debian/${debFileName}"
String rpmfile = "artifact://${env.JOB_NAME}/${env.BUILD_NUMBER}#target/rpm/${rpmFileName}"
String susefile = "artifact://${env.JOB_NAME}/${env.BUILD_NUMBER}#target/suse/${suseFileName}"

timestampedNode("docker") {
stage "Load Lib"
dir('workflowlib') {
deleteDir()
git branch: packagingBranch, url: 'https://github.com/jenkinsci/packaging.git'
flow = load 'workflow/installertest.groovy'
}
}
// Run the real tests within docker node label
flow.fetchAndRunJenkinsInstallerTest("docker", rpmfile, susefile, debfile,
packagingBranch, artifactName, jenkinsPort)
} else {
echo "Not running package testing against pull requests"
}
} else {
echo "Skipping package tests"
}


// This method sets up the Maven and JDK tools, puts them in the environment along
// with whatever other arbitrary environment variables we passed in, and runs the
// body we passed in within that environment.
void withMavenEnv(List envVars = [], def body) {
// The names here are currently hardcoded for my test environment. This needs
// to be made more flexible.
// Using the "tool" Workflow call automatically installs those tools on the
// node.
String mvntool = tool name: "mvn3.3.3", type: 'hudson.tasks.Maven$MavenInstallation'
String jdktool = tool name: "jdk7_80", type: 'hudson.model.JDK'

// Set JAVA_HOME, MAVEN_HOME and special PATH variables for the tools we're
// using.
List mvnEnv = ["PATH+MVN=${mvntool}/bin", "PATH+JDK=${jdktool}/bin", "JAVA_HOME=${jdktool}", "MAVEN_HOME=${mvntool}"]

// Add any additional environment variables.
mvnEnv.addAll(envVars)

// Invoke the body closure we're passed within the environment we've created.
withEnv(mvnEnv) {
body.call()
}
}

// Runs the given body within a Timestamper wrapper on the given label.
def timestampedNode(String label, Closure body) {
node(label) {
wrap([$class: 'TimestamperBuildWrapper']) {
body.call()
}
}
}
19 changes: 16 additions & 3 deletions README.md
@@ -1,19 +1,32 @@
[![][ButlerImage]][website]

# About
In a nutshell, Jenkins CI is the leading open-source continuous integration server. Built with Java, it provides over 1000 plugins to support building and testing virtually any project.
In a nutshell, Jenkins is the leading open-source automation server.
Built with Java, it provides over 1000 plugins to support automating virtually anything,
so that humans can actually spend their time doing things machines cannot.

# What to Use Jenkins for and When to Use It

Use Jenkins to automate your development workflow so you can focus on work that matters most. Jenkins is commonly used for:

- Building projects
- Running tests to detect bugs and other issues as soon as they are introduced
- Static code analysis
- Deployment

Execute repetitive tasks, save time, and optimize your development process with Jenkins.

# Downloads
Non-source downloads such as WAR files and several Linux packages can be found on our [Mirrors].

# Source
Our latest and greatest source of Jenkins CI can be found on [GitHub]. Fork us!
Our latest and greatest source of Jenkins can be found on [GitHub]. Fork us!

# Contributing to Jenkins
Follow [contributing](CONTRIBUTING.md) file.

# News and Website
All information about Jenkins CI can be found on our [website]. Follow us on Twitter [@jenkinsci].
All information about Jenkins can be found on our [website]. Follow us on Twitter [@jenkinsci].

# License
Jenkins is **licensed** under the **[MIT License]**. The terms of the license are as follows:
Expand Down
47 changes: 44 additions & 3 deletions changelog.html
Expand Up @@ -55,9 +55,50 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class="rfe">
Move periodic task log files from <code>JENKINS_HOME/*.log</code> to <code>JENKINS_HOME/logs/tasks/*.log</code> and rotate them periodically rather than overwrite every execution
(<a href-"https://issues.jenkins-ci.org/browse/JENKINS-33068">issue 33068</a>)
</ul>
</div><!--=TRUNK-END=-->
<h3><a name=v1.650>What's new in 1.650</a> (2016/02/24)</h3>
<ul class=image>
<li class="major bug">
<strong>Important security fixes</strong>
(<a href="https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-02-24">security advisory</a>)
</ul>
<h3><a name=v1.649>What's new in 1.649</a> (2016/02/21)</h3>
<ul class=image>
<li class="rfe">
Allow changing the directory used for the extraction of plugin archives via the <code>--pluginroot</code> CLI option (also controllable via the <code>hudson.PluginManager.workDir</code> system property / context parameter. Also document the <code>--webroot</code> CLI parameter in <code>java -jar jenkins.war --help</code>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-32765">issue 32765</a>)
<li class="rfe">
Unify CLI exit code semantics.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-32273">issue 32273</a>)
<li class="bug">
ArrayIndexOutOfBoundsException when parsing range set.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-32852">issue 32852</a>)
<li class="rfe">
Improved Polish translation.
(<a href="https://github.com/jenkinsci/jenkins/pull/2041">pull 2041</a>,
<a href="https://github.com/jenkinsci/jenkins/pull/2044">pull 2044</a>)
</ul>
<h3><a name=v1.648>What's new in 1.648</a> (2016/02/17)</h3>
<ul class=image>
<li class="rfe">
Improved Czech and Polish translation.
(<a href="https://github.com/jenkinsci/jenkins/pull/2008">pull 2008</a>,
<a href="https://github.com/jenkinsci/jenkins/pull/2018">pull 2017</a>,
<a href="https://github.com/jenkinsci/jenkins/pull/2017">pull 2018</a>)
<li class="bug">
Generate new instance identity file when the existing one is found to be corrupt.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-29240">issue 29240</a>)
</ul>
<h3><a name=v1.647>What's new in 1.647</a> (2016/02/04)</h3>
<ul class=image>
<li class="bug">
Retrieve tool installer metadata from all update sites.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-32328">issue 32328</a>)
</ul>
<h3><a name=v1.646>What's new in 1.646</a> (2016/01/25)</h3>
<ul class=image>
<li class="major rfe">
Expand Down Expand Up @@ -1479,7 +1520,7 @@ <h3><a name=v1.564>What's new in 1.564</a> (2014/05/19)</h3>
<h3><a name=v1.563>What's new in 1.563</a> (2014/05/11)</h3>
<ul class=image>
<li class="major bug">
Memory exhausion in remoting channel since 1.560.
Memory exhaustion in remoting channel since 1.560.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22734">issue 22734</a>)
<li class="rfe">
Configurable size for log buffer.
Expand Down Expand Up @@ -1623,7 +1664,7 @@ <h3><a name=v1.560>What's new in 1.560</a> (2014/04/20)</h3>
Fixed NoSuchMethodException when destroying processes using JDK1.8.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21341">issue 21341</a>)
<li class=rfe>
Avoid irrelevant job queing while node is offline.
Avoid irrelevant job queuing while node is offline.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21394">issue 21394</a>)
<li class=rfe>
Debian package now creates 'jenkins' group
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-1-SNAPSHOT</version>
<version>2.0-alpha-3-SNAPSHOT</version>
</parent>

<artifactId>cli</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions core/pom.xml
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>2.0-alpha-1-SNAPSHOT</version>
<version>2.0-alpha-3-SNAPSHOT</version>
</parent>

<artifactId>jenkins-core</artifactId>
Expand All @@ -39,7 +39,7 @@ THE SOFTWARE.

<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.237</stapler.version>
<stapler.version>1.239</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>1.8.9</groovy.version>
</properties>
Expand Down Expand Up @@ -243,8 +243,8 @@ THE SOFTWARE.
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
@@ -1,5 +1,6 @@
# This file is under the MIT License by authors

NewVersionAvailable=Nowa wersja Jenkinsa ({0}) jest dost\u0119pna do <a href="{1}">pobrania</a> (<a href="${changelog.url}">changelog</a>).
NewVersionAvailable=Nowa wersja Jenkinsa ({0}) jest dost\u0119pna do <a href="{1}">pobrania</a> (<a href="${changelog.url}">historia zmian</a>).
Or\ Upgrade\ Automatically=Albo uaktualnij automatycznie
UpgradeCompleteRestartNotSupported=Aktualizacja Jenkinsa do wersji {0} zako\u0144czy\u0142a si\u0119 pomy\u015Blnie, oczekiwanie na ponowne uruchomienie.
UpgradeProgress=Aktualizacja Jenkinsa do wersji {0} <a href="{1}">trwa lub nie powiod\u0142a si\u0119</a>.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/ClassicPluginStrategy.java
Expand Up @@ -167,7 +167,8 @@ private static Manifest loadLinkedManifest(File archive) throws IOException {
if (archive.isDirectory()) {// already expanded
expandDir = archive;
} else {
expandDir = new File(archive.getParentFile(), getBaseName(archive.getName()));
File f = pluginManager.getWorkDir();
expandDir = new File(f == null ? archive.getParentFile() : f, getBaseName(archive.getName()));
explode(archive, expandDir);
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/hudson/EnvVars.java
Expand Up @@ -63,7 +63,7 @@
*
* <p>
* In Jenkins, often we need to build up "environment variable overrides"
* on master, then to execute the process on slaves. This causes a problem
* on master, then to execute the process on agents. This causes a problem
* when working with variables like <tt>PATH</tt>. So to make this work,
* we introduce a special convention <tt>PATH+FOO</tt> &mdash; all entries
* that starts with <tt>PATH+</tt> are merged and prepended to the inherited
Expand Down Expand Up @@ -134,7 +134,7 @@ public void override(String key, String value) {
String v = get(realKey);
if(v==null) v=value;
else {
// we might be handling environment variables for a slave that can have different path separator
// we might be handling environment variables for a agent that can have different path separator
// than the master, so the following is an attempt to get it right.
// it's still more error prone that I'd like.
char ch = platform==null ? File.pathSeparatorChar : platform.pathSeparator;
Expand Down Expand Up @@ -421,8 +421,8 @@ public EnvVars call() {
* variables only when you access this from the master.
*
* <p>
* If you access this field from slaves, then this is the environment
* variable of the slave agent.
* If you access this field from agents, then this is the environment
* variable of the agent agent.
*/
public static final Map<String,String> masterEnvVars = initMaster();

Expand Down

0 comments on commit 03291cf

Please sign in to comment.