curl上传软件包并安装

时间:2018-12-05 21:59:11

标签: curl aem cq5 aem-6

我在上载软件包并安装curl命令时遇到问题,它对我不起作用。这在AEM 6.1中不可用吗?

curl -u admin:admin -F file = @“ zip文件名” -F name =“包名” -F force = true -F install = true http://localhost:4502/crx/packmgr/service.jsp

当我第一次使用 curl -u admin:admin -F package = @“ name_of_package.zip” http://localhost:4502/crx/packmgr/service/.json/?cmd=upload

然后使用 curl -u admin:软件包的-X POST http://localhost:4505/crx/packmgr/service/.json/etc/packages/export/name?cmd = install

然后正常工作。

以下是我上传并安装的响应

<crx version="1.2.11" user="admin" workspace="crx.default">
   <request>
      <param name="package" value="common-tools-package-1.0.6.zip"/>
      <param name="name" value="common-tools-package"/>
      <param name="force" value="true"/>
      <param name="install" value="true"/>
   </request>
   <response>
      <data>       +------------+-----------------------------------------+        |  Arguments | Comment                                 |        +------------+-----------------------------------------+        |  cmd=help  | print this help                         |        +------------+-----------------------------------------+        |  cmd=ls    | print a list of all packages            |        +------------+-----------------------------------------+        |  cmd=rm    | remove a  package                       |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=build | build a  package                        |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=inst  | install a package                       |        |  name      | package name                            |        |  [strict]  | true to fail on error                   |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=uninst| uninstall a package                     |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  GET       | download a package                      |        |            | (content-disposition header contains    |        |            | the correct filename)                   |        |  [cmd=get] | optional                                |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  POST      | upload a new package                    |        |  file      | package to upload                       |        |  [name]    | optional name                           |        |  [strict]  | true to fail on install error           |        |  [install] | automatically install package if 'true' |        +------------+-----------------------------------------+      </data>
      <status code="200">ok</status>
   </response>
</crx>

1 个答案:

答案 0 :(得分:0)

在进度条中尝试以下命令,并从软件包目录中运行它。

卷曲-u用户名:密码-F文件= @“。/YourPackage.zip” -F名称=“包裹” -F力= true -F install = true http://localhost:4502/crx/packmgr/service.jsp --progress-栏-o upload.txt