Installing application from file


#1

Enonic version: 7.1.0
OS: MacOS, RHEL7

I’m looking for a way to deploy an application to XP7 from a jar file.
With XP6 you had the endpoint “/admin/rest/application/install” to, and I assume https://developer.enonic.com/docs/xp/stable/runtime/management#install_from_file is the new version of that. The documentation is a bit thin though, and there are no examples.
I have a hard time uploading a file, the closest I come is this Curl command, and it responds that it cannot consume content type.
curl -i -X POST http://localhost:4848/app/install --data @mimir-1.0.0-SNAPSHOT.jar --user gle:hunter2 -v


#2

Hi Hunter :slight_smile:
Did you try using the CLI?


#3

Yeah I´d rather not have a dependency to the CLI on my build servers if I can avoid it. External dependencies like that makes it hard to replicate a working setup and might be a concern moving to the cloud - the CLI is great on a local computer though!


#4

Hi, try this:

curl -i -X POST http://localhost:4848/app/install -F [email protected] --user gle:hunter -v

I’m sure that there are sane ways of including the CLI on your build-servers though :slight_smile:


#5

Perfect, that worked! thanks a ton.
Regarding CI, I´d be really interested in hearing more about how I can use the CLI on build servers. Do you have any advice on how to go about it? We’re currently using on-prem Jenkins but will be moving to cloud solutions (CircleCI or Github actions) soon.


#6

Hi, we are doing some testing on different CI-solutions these days, will get back to you on this.


#7

Hey. We recently wrote a guide on how to do this. Check it out and let us know what you think: https://developer.enonic.com/guides/ci-cd-for-xp-apps