create constants and ui for packages upload runner
authorEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 10:14:36 +0000 (14:14 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Thu, 21 Jul 2011 11:53:25 +0000 (15:53 +0400)
nuget-common/src/jetbrains/buildServer/nuget/common/PackagesConstants.java
nuget-server/resources/install/viewInstallPackage.jsp
nuget-server/resources/publish/editPublish.jsp [new file with mode: 0644]
nuget-server/resources/publish/viewPublish.jsp [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/publish/PublishBean.java [new file with mode: 0644]

index 29b929fb2dc8e6940a6b4c5eb407ebafce9a00be..62dad9afedc3ecf0a90399bb0fb30a439e4aebef 100644 (file)
@@ -17,6 +17,7 @@
 package jetbrains.buildServer.nuget.common;\r
 \r
 import jetbrains.buildServer.ArtifactsConstants;\r
 package jetbrains.buildServer.nuget.common;\r
 \r
 import jetbrains.buildServer.ArtifactsConstants;\r
+import jetbrains.buildServer.agent.Constants;\r
 \r
 /**\r
  * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
 \r
 /**\r
  * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
@@ -39,4 +40,10 @@ public interface PackagesConstants {
 \r
   public static final String NUGET_USED_PACKAGES_DIR = ArtifactsConstants.TEAMCITY_ARTIFACTS_DIR + "/nuget";\r
   public static final String NUGET_USED_PACKAGES_FILE = "nuget.xml";\r
 \r
   public static final String NUGET_USED_PACKAGES_DIR = ArtifactsConstants.TEAMCITY_ARTIFACTS_DIR + "/nuget";\r
   public static final String NUGET_USED_PACKAGES_FILE = "nuget.xml";\r
+\r
+\r
+  public static final String NUGET_PUBLISH_CREATE_ONLY = "nuget.publish.create.only";\r
+  public static final String NUGET_PUBLISH_FILES = "nuget.publish.files";\r
+  public static final String NUGET_PUBLISH_SOURCE = "nuget.publish.source";\r
+  public static final String NUGET_API_KEY = Constants.SECURE_PROPERTY_PREFIX + "nuget.api.key";\r
 }\r
 }\r
index a2a87150a1d66898e5bd3aa35daefac2bcd75ab9..a62e79c4c09ffde974f3d5d3899bdc195c526a83 100644 (file)
@@ -24,7 +24,7 @@
 </div>\r
 <div class="parameter">\r
   Package Sources: <strong><props:displayValue name="${ib.nuGetSourcesKey}"\r
 </div>\r
 <div class="parameter">\r
   Package Sources: <strong><props:displayValue name="${ib.nuGetSourcesKey}"\r
-                                               emptyValue="Use nuget.org package source"/></strong>\r
+                                               emptyValue="Use nuget default package source"/></strong>\r
 </div>\r
 <div class="parameter">\r
   Path to .sln: <strong><props:displayValue name="${ib.solutionPathKey}"/></strong>\r
 </div>\r
 <div class="parameter">\r
   Path to .sln: <strong><props:displayValue name="${ib.solutionPathKey}"/></strong>\r
diff --git a/nuget-server/resources/publish/editPublish.jsp b/nuget-server/resources/publish/editPublish.jsp
new file mode 100644 (file)
index 0000000..81e9b0a
--- /dev/null
@@ -0,0 +1,76 @@
+<%--\r
+  ~ Copyright 2000-2011 JetBrains s.r.o.\r
+  ~\r
+  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
+  ~ you may not use this file except in compliance with the License.\r
+  ~ You may obtain a copy of the License at\r
+  ~\r
+  ~ http://www.apache.org/licenses/LICENSE-2.0\r
+  ~\r
+  ~ Unless required by applicable law or agreed to in writing, software\r
+  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  ~ See the License for the specific language governing permissions and\r
+  ~ limitations under the License.\r
+  --%>\r
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+<jsp:useBean id="ib" class="jetbrains.buildServer.nuget.server.publish.PublishBean" scope="request"/>\r
+\r
+<l:settingsGroup title="NuGet settings">\r
+  <tr>\r
+    <th>Path to NuGet.exe<l:star/></th>\r
+    <td>\r
+      <props:textProperty name="${ib.nuGetPathKey}" className="longField"/>\r
+      <span class="smallNote">Specify path to NuGet.exe</span>\r
+      <span class="error" id="error_${ib.nuGetPathKey}"></span>\r
+    </td>\r
+  </tr>\r
+  <tr>\r
+    <th>Package Sources</th>\r
+    <td>\r
+      <props:textProperty name="${ib.nuGetSourceKey}" className="longField"/>\r
+      <span class="smallNote">\r
+        Specify NuGet package sources to push package.\r
+        Leave blank to let NuGet decided what package repository to use (nuget.org by default).\r
+      </span>\r
+      <span class="error" id="error_${ib.nuGetSourceKey}"></span>\r
+    </td>\r
+  </tr>\r
+  <tr>\r
+    <th>API key:<l:star/></th>\r
+    <td>\r
+      <props:textProperty name="${ib.apiKey}" className="longField"/>\r
+      <span class="smallNote">\r
+        Specify API key to access NuGet source.\r
+      </span>\r
+      <span class="error" id="error_${ib.apiKey}"></span>\r
+    </td>\r
+  </tr>\r
+</l:settingsGroup>\r
+\r
+<l:settingsGroup title="Packages">\r
+  <tr>\r
+    <th>Packages to uploads:<l:star/></th>\r
+    <td>\r
+      <props:multilineProperty name="${ib.nuGetPublishFilesKey}" linkTitle="Packages files"\r
+                               cols="60" rows="5"\r
+                               expanded="${true}"/>\r
+      <span>Specify NuGet package files to push to NuGet Feed. Each file on new line.</span>\r
+      <span class="error" id="error_${ib.nuGetPublishFilesKey}"></span>\r
+    </td>\r
+  </tr>\r
+  \r
+  <tr>\r
+    <th>Options:</th>\r
+    <td>\r
+      <props:checkboxProperty name="${ib.nuGetPublishCreateOnlyKey}"/>\r
+      Only upload package but do not pusblish it to feed.\r
+      <span class="smallNote">\r
+        Specifies if the package should be created and uploaded to the server but not published to the server.\r
+      </span>\r
+    </td>\r
+  </tr>\r
+</l:settingsGroup>
\ No newline at end of file
diff --git a/nuget-server/resources/publish/viewPublish.jsp b/nuget-server/resources/publish/viewPublish.jsp
new file mode 100644 (file)
index 0000000..7d46a79
--- /dev/null
@@ -0,0 +1,36 @@
+<%--\r
+  ~ Copyright 2000-2011 JetBrains s.r.o.\r
+  ~\r
+  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
+  ~ you may not use this file except in compliance with the License.\r
+  ~ You may obtain a copy of the License at\r
+  ~\r
+  ~ http://www.apache.org/licenses/LICENSE-2.0\r
+  ~\r
+  ~ Unless required by applicable law or agreed to in writing, software\r
+  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  ~ See the License for the specific language governing permissions and\r
+  ~ limitations under the License.\r
+  --%>\r
+<%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>\r
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>\r
+<%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>\r
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>\r
+<jsp:useBean id="ib" class="jetbrains.buildServer.nuget.server.publish.PublishBean" scope="request"/>\r
+\r
+<div class="parameter">\r
+  Path to NuGet.exe: <strong><props:displayValue name="${ib.nuGetPathKey}"/></strong>\r
+</div>\r
+<div class="parameter">\r
+  Package Sources: <strong><props:displayValue name="${ib.nuGetSourceKey}"\r
+                                               emptyValue="Use default source"/></strong>\r
+</div>\r
+\r
+<div class="parameter">\r
+  Packages to upload: <strong><props:displayValue name="${ib.nuGetPublishFilesKey}" showInPopup="${true}"/></strong>\r
+</div>\r
+\r
+<div class="parameter">\r
+  Publish package in feed: <strong><props:displayCheckboxValue name="${ib.nuGetPublishCreateOnlyKey}" checkedValue="False" uncheckedValue="True"/></strong>\r
+</div>\r
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/publish/PublishBean.java b/nuget-server/src/jetbrains/buildServer/nuget/server/publish/PublishBean.java
new file mode 100644 (file)
index 0000000..0cf5bd4
--- /dev/null
@@ -0,0 +1,31 @@
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.server.publish;\r
+\r
+import jetbrains.buildServer.nuget.common.PackagesConstants;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 21.07.11 13:51\r
+ */\r
+public class PublishBean {\r
+  public String getNuGetPathKey() { return PackagesConstants.NUGET_PATH; }\r
+  public String getNuGetSourceKey() { return PackagesConstants.NUGET_PUBLISH_SOURCE; }\r
+  public String getApiKey() { return PackagesConstants.NUGET_API_KEY; }\r
+  public String getNuGetPublishFilesKey() {return PackagesConstants.NUGET_PUBLISH_FILES; }\r
+  public String getNuGetPublishCreateOnlyKey() { return PackagesConstants.NUGET_PUBLISH_CREATE_ONLY; }\r
+}\r