Merge remote-tracking branch 'origin/master' into feature/UX-12

This commit is contained in:
Vivek Pandey 2016-02-23 21:50:53 -08:00
commit bdcb18a19a
117 changed files with 107 additions and 758 deletions

8
.gitignore vendored
View File

@ -6,9 +6,9 @@
target/*
**/target/*
*~
core/node
core/node_modules
core/work
blueocean-web/node
blueocean-web/node_modules
blueocean-web/work
work
war/overlays
app.properties

View File

@ -9,16 +9,14 @@ Blue Ocean is the new UI project for Jenkins.
# Module Breakdown
## core
All core functionality code lives here.
## blueocean-web
BlueOcean Web module, everything web related lives here including root url handling.
* js
* blueocean.js
* It is the entry point for blueocean UI. It defines extension point and for demonstration it defines dependency on another extension **name**
* java
* embryo
* Replaces classic jenkins, will eventually be replaced by embryo code
* blueocean
* BlueOceanUI.java is entry point for blue ocean backend
@ -28,35 +26,32 @@ All core functionality code lives here.
* pom.xml
* *metrics* and *variant* plugins are there for example to show this is where we can add dependency on external plugins
## alpha and bravo
These are just example of extensions. In due course we will be adding such extensions to this repo.
## all
This is where you run the app to include all plugins along with core. During development it can be used to include all extensions.
## war
## blueocean-plugin
Generates BlueOcean standalone war file, to be run as *java -jar blueocean.war*.
This does not include embedded-driver as it's a plugin to be installed on standalone jenkins war.
BlueOcean Jenkins plugin.
# Build and Run
## Build and run core module
mvn clean install
mvn clean install -DskipTests # to skip running tests
## Build and run BlueOcean Jenkins plugin
```
$ cd core
$ cd blueocean-plugin
$ mvn hpi:run
```
- Open http://localhost:8080/jenkins in your browser. Also open JS console on the browser to see message printed from blueocean.js.
- Open http://localhost:8080/jenkins/bo in your browser. Also open JS console on the browser to see message printed from blueocean.js.
- Open http://localhost:8080/jenkins/hello in your browser. "Hello World" is printed by BlueOceanUI.doHello() method.
## To do javascript development
If you wish to make changes to blueocean.js, then you will need to install gulp (http://gulpjs.com/), and then either run:
>TODO: maven profile that defines dependency on blueocean-plugin to do UI development
```
$ ./dev_core.sh
```

View File

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.jenkins.blueocean</groupId>
<artifactId>blueocean-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>blueocean-all</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Aggregator</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pipeline-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>profile-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>embedded-driver</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.blueocean</groupId>
<artifactId>blueocean-authentication-service</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-github-oauth-plugin</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- links to all the plugins via hpl for live reloading -->
<source>
def plugins = new File(basedir, 'work/plugins');
for (dep in project.dependencies) {
if (dep.groupId != project.groupId) {
continue;
}
def a = dep.artifactId;
def theHpl = new File(new File(basedir.parentFile, a.replaceFirst('^blueocean-', '')), 'target/test-classes/the.hpl');
if (theHpl.file) {
plugins.mkdirs();
ant.copy(file: theHpl, tofile: new File(plugins, a + '.hpl'), overwrite: true, verbose: true);
} else {
println('Warning: no such file ' + theHpl);
}
}
</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>InjectedTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,4 +0,0 @@
<?jelly escape-by-default='true'?>
<div>
Aggregator
</div>

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.jenkins.blueocean</groupId>
<artifactId>blueocean-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>blueocean-alpha</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Alpha Plugin</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-commons</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +0,0 @@
package io.jenkins.blueocean;
/**
* @author Kohsuke Kawaguchi
*/
public class FutureCode {
}

View File

@ -10,14 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<name>BlueOcean :: Authentication Service API</name>
<artifactId>authentication-service-api</artifactId>
<artifactId>blueocean-authentication-service-api</artifactId>
<packaging>hpi</packaging>
<dependencies>
<!-- included for models only -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>profile-service-api</artifactId>
<artifactId>blueocean-profile-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>

View File

@ -20,7 +20,7 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>authentication-service-api</artifactId>
<artifactId>blueocean-authentication-service-api</artifactId>
</dependency>
</dependencies>

View File

@ -11,7 +11,7 @@
<artifactId>blueocean-commons</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: BlueOcean Commons API</name>
<name>BlueOcean :: Commons API</name>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>

View File

@ -11,10 +11,11 @@
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>io.jenkins.blueocean</groupId>
<artifactId>blueocean-github-oauth-plugin</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Github OAuth Plugin</name>
<dependencies>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>

View File

@ -8,7 +8,7 @@
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>pipeline-service-api</artifactId>
<artifactId>blueocean-pipeline-service-api</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Pipeline Service API</name>

View File

@ -9,12 +9,16 @@
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>embedded-driver</artifactId>
<artifactId>blueocean-plugin</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: BlueOcean Embedded Service API Driver</name>
<name>BlueOcean :: Jenkins Plugin</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-web</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-commons</artifactId>
@ -25,15 +29,15 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>profile-service-api</artifactId>
<artifactId>blueocean-profile-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pipeline-service-api</artifactId>
<artifactId>blueocean-pipeline-service-api</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.blueocean</groupId>
<artifactId>authentication-service-api</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-authentication-service-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>

View File

@ -8,7 +8,7 @@
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>profile-service-api</artifactId>
<artifactId>blueocean-profile-service-api</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Profile Service API</name>

View File

@ -0,0 +1,22 @@
package io.jenkins.blueocean.api.profile;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.jenkins.blueocean.api.profile.model.Organization;
import io.jenkins.blueocean.security.Identity;
import javax.annotation.Nullable;
/**
* Response for createOrganization(Identity, CreateOrganizationRequest)}
*
* @author Vivek Pandey
*/
public class CreateOrganizationResponse {
@JsonProperty("organization")
public final Organization organization;
public CreateOrganizationResponse(@Nullable @JsonProperty("organization")Organization organization) {
this.organization = organization;
}
}

View File

@ -1,6 +1,5 @@
package io.jenkins.blueocean.api.profile;
import io.jenkins.blueocean.api.profile.model.Organization;
import io.jenkins.blueocean.api.profile.model.User;
import io.jenkins.blueocean.security.Identity;

View File

@ -0,0 +1,31 @@
package io.jenkins.blueocean.api.profile;
import io.jenkins.blueocean.api.profile.model.Organization;
import io.jenkins.blueocean.commons.JsonConverter;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Vivek Pandey
*/
public class CreateOrganizationResponseTest {
@Test
public void serializeDeserialize(){
CreateOrganizationResponse response = new CreateOrganizationResponse(new Organization("cloudbees"));
Assert.assertNotNull(response.organization);
String json = JsonConverter.toJson(response);
System.out.println("Converted from Java:\n"+json);
CreateOrganizationResponse responseFromJson = JsonConverter.toJava(json, CreateOrganizationResponse.class);
Assert.assertNotNull(responseFromJson.organization);
Assert.assertEquals(response.organization.name, responseFromJson.organization.name);
System.out.println("Converted back from Json:\n"+JsonConverter.toJson(responseFromJson));
}
}

View File

@ -16,35 +16,27 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-core</artifactId>
<version>${project.version}</version>
<artifactId>blueocean-web</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>blueocean-security-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>profile-service-api</artifactId>
<version>${project.version}</version>
<artifactId>blueocean-profile-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pipeline-service-api</artifactId>
<version>${project.version}</version>
<artifactId>blueocean-pipeline-service-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -12,7 +12,7 @@
<artifactId>blueocean-security-api</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: BlueOcean Security API</name>
<name>BlueOcean :: Security API</name>
<dependencies>
<dependency>

View File

@ -9,10 +9,10 @@
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>blueocean-core</artifactId>
<artifactId>blueocean-web</artifactId>
<packaging>hpi</packaging>
<name>BlueOcean :: Core</name>
<name>BlueOcean :: Web module</name>
<dependencies>
<dependency>
@ -31,11 +31,11 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>profile-service-api</artifactId>
<artifactId>blueocean-profile-service-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>authentication-service-api</artifactId>
<artifactId>blueocean-authentication-service-api</artifactId>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>

View File

@ -1,17 +1,7 @@
package io.jenkins.blueocean;
import com.google.inject.Inject;
import hudson.Extension;
import hudson.ExtensionList;
import io.jenkins.blueocean.api.profile.GetUserDetailsRequest;
import io.jenkins.blueocean.api.profile.ProfileService;
import io.jenkins.blueocean.config.ApplicationConfig;
import io.jenkins.blueocean.security.Cookies;
import io.jenkins.blueocean.security.Identity;
import io.jenkins.blueocean.security.LoginAction;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.Stapler;
/**
* Root of Blue Ocean UI

Some files were not shown because too many files have changed in this diff Show More