Permalink
Browse files

BZ849348

  • Loading branch information...
1 parent e0e117e commit e4be6ea920178a32eec3142d4ed0c6e2078cef18 @bdecoste bdecoste committed Aug 20, 2012
View
@@ -167,6 +167,6 @@
<classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jvnet/hudson/xstream/1.3.1-hudson-8/xstream-1.3.1-hudson-8.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry combineaccessrules="false" kind="src" path="/openshift-java-client-bdecoste"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/openshift-java-client"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
View
@@ -85,7 +85,7 @@
<dependency>
<groupId>com.openshift</groupId>
<artifactId>openshift-java-client</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.0</version>
</dependency>
</dependencies>
@@ -57,9 +57,6 @@
import com.openshift.client.configuration.DefaultConfiguration;
import com.openshift.client.configuration.SystemConfiguration;
import com.openshift.client.configuration.UserConfiguration;
-import com.openshift.internal.client.ApplicationResource;
-import com.openshift.internal.client.UserResource;
-import com.openshift.internal.client.utils.StreamUtils;
/**
* Represents the available cloud of OpenShift instances for building.
@@ -84,7 +81,7 @@
private transient File privateKey;
private String brokerAuthKey;
private String brokerAuthIV;
- private IOpenShiftConnection service;
+ private transient IOpenShiftConnection service;
static {
javax.net.ssl.HttpsURLConnection
@@ -26,6 +26,7 @@
import com.openshift.client.IApplication;
import com.openshift.client.ICartridge;
import com.openshift.client.IDomain;
+import com.openshift.client.IGearProfile;
import com.openshift.client.IOpenShiftConnection;
import com.openshift.client.IUser;
import com.openshift.client.OpenShiftException;
@@ -229,11 +230,21 @@ public void provision() throws Exception {
private void createApp() throws IOException, OpenShiftException {
- IUser user = OpenShiftCloud.get().getOpenShiftConnection().getUser();
+ IOpenShiftConnection connection = OpenShiftCloud.get().getOpenShiftConnection();
+ IUser user = connection.getUser();
ICartridge cartridge = getCartridge(OpenShiftCloud.get().getOpenShiftConnection());
+
+ IDomain domain = user.getDefaultDomain();
+ List<IGearProfile> gearProfiles = domain.getAvailableGearProfiles();
+ IGearProfile gearProfile = gearProfiles.get(0);
+ for (IGearProfile profile : gearProfiles) {
+ if (profile.getName().equals(builderSize))
+ gearProfile = profile;
+ }
+
+ LOGGER.info("Creating builder application " + framework + " " + name + " " + user.getDefaultDomain().getId() + " of size " + gearProfile.getName() + " ...");
- LOGGER.info("Creating builder application " + framework + " " + name + " " + user.getDefaultDomain().getId() + " ...");
- IApplication app = user.getDefaultDomain().createApplication(name, cartridge);
+ IApplication app = domain.createApplication(name, cartridge, gearProfile);
}

0 comments on commit e4be6ea

Please sign in to comment.