0

I have built a Build & Release pipeline through Visual Studio Team Services. The build process are executed using the Cumulocity framework c8y. For the release I would like to bring my packed (zip-file) web application automatically to the Cumulocity platform.

The framework c8y does not support upload of the web application as zip-file? Maybe the upload to my Cumulocity tenant is possible via REST? I would be grateful for your experiences on this topic.

Cumulocity / Own applications / Upload ZIP file

Brenners Daniel
  • 389
  • 5
  • 15

3 Answers3

1

I think this is what you need (I have never tried it before):

C8Y Binaries API

If your application is a cockpit base app you can add the plugins you have created :

POST /application/applications/<<application_id>>/binaries/plugins/<<plugin_name>> HTTP/1.1
Accept: application/vnd.com.nsn.cumulocity.managedObject+json
Content-Type: multipart/form-data; boundary=myBoundary
Content-Disposition: form-data; name="file"
Content-Length: 742
Authorization: Basic ...

--myBoundary
Content-Disposition: form-data; name="file"; filename="hello-world- 
application.zip"
Content-Type: application/zip

... zip content ...
--myBoundary--

if you have created a custom app then you should use :

POST /application/applications/<<application_id>>/binaries/files 
HTTP/1.1
Accept: application/vnd.com.nsn.cumulocity.managedObject+json
Content-Type: multipart/form-data; boundary=myBoundary
Content-Disposition: form-data; name="filepath"
Content-Length: 742
Authorization: Basic ...

--myBoundary
Content-Disposition: form-data; name="filepath";filename="index.html"

... zip content ...
--myBoundary--

Here the documentation assumes that you already created the app. In this case you should use this documentation in order to get the app you want to update.

Hope this helps! good luck with your tests!

Jorge
  • 238
  • 1
  • 10
0

As a last resort you could open your browser's dev tools and check what request is being sent when you upload the zip file.

Georgi
  • 165
  • 1
  • 9
0

I deployed my App using the Cumulocity Board Tools (C8Y). In my Visual Studio Team Services Release-Process the Windows Environment Variables are set by Command Line task (C8Y_USER, C8Y_PASS, C8Y_BASE_URL, C8Y_TENANT).

These Variables are Cumulocity standard Variables for deploy process. In another task, I start the deployment via Command Line (c8y deploy:app myapplication).

The date for the specified Windows Environment Variables is stored as a secure Variable in VSTS (Read-only). After each deployment, these are overwritten again on the Build-Server.

SETX C8Y_USER $(C8Y_USER)
SETX C8Y_PASS $(C8Y_PASS)
SETX C8Y_TENANT $(C8Y_TENANT)
SETX C8Y_BASE_URL $(C8Y_BASE_URL)

c8y deploy:app myapplication

Each Cumulocity Tenant can be controlled via Release Variables with user and password.

Brenners Daniel
  • 389
  • 5
  • 15