Is there any way to upload Artifacts to the Apache ACE server without Web UI? - osgi

We are working on an enterprise system writed by Java. And we use an Apache ACE server to deploy the OSGi bundles, a Jenkins as CI server. When we want to update a bundle, we make a jar file in Eclipse, and upload it to ACE server through Web UI. When we want to release a new version, we must upload all bundles through Web UI. I think that is foolish.
I think there must be a simple way just like when I finish coding, then I can do something just in Elipse to upload the bundle to the ACE server. When we release a version, the Jenkins should also update all of the bundles to ACE server itself.

Certainly, you basically have two options if you want to automate things:
Use the REST based interface to talk to ACE.
Use the shell based interface to script to ACE.
Both are explained on the website, so for more detailed steps refer to:
http://ace.apache.org/docs/rest-api.html
http://ace.apache.org/docs/shell-api.html

Related

XrmToolBox PluginRegistration. Edit Plugin Step Configuration from plugin code

How can I modify the Unsecure and Secure Configuration in plugin code for step?
For example, I have a plugin and I will send it to my friend. I want this plugin to clean or modify all information that my friend has in his XrmToolBox Plugin Step Secure Configuration field and add mine (for me is necessary to add mine config in this field). Can I do it from code in my plugin?
Let's make the things straight.
CRM Plugin is an executable code logic for extending the platform execution pipeline like do something (ex. Assign/Update) after something (ex. Create/Update) happens.
Plugin registration tool (PRT) is useful for registering the Plugin assembly (dll) & steps to execute per our expectation.
Secure/Unsecure config for Plugin step is just like web.config in our web application. Read more
You want to configure certain key/value pair, for example - some external web service credentials, then put it in secure config of that particular plugin step using PRT, so that you can consume it inside the plugin step code logic.
We will not update the secure config from the plugin code, rather we will just consume it.
If you are shipping your environment plugin steps to your friend environment, then give the plugin assembly & step as a solution package, once the solution is imported in your friend environment - the XrmToolBox PRT will show the changes. Or connect the two environments in different PRT sessions & verify the differences for config merge process.
If you want to develop a console app or something to do the deployment for you, read the below link:
Programatically Updating the Secure Configuration of a Plug-in Step

Hide "publish" button from dev server

My site is meant to be published by the continuous integration hook in my git server. The continuous integration script runs lektor deploy.
As such, I need the publish settings in my project file, but I don't like the peril of having an easily-acessible publish button that can be fat-fingered.
I don't see anything like that in the command-line docs. Is that not possible?
You should be using lektor build instead and serve your site with a proper http server. (or deploy remotely e.g. with lektor deploy)
The dev server is meant to be just that, used for development. Running it in production might well be a security risk.

Building JAR files in a Heroku app

I have a web app running on Heroku from which I need to build and make available a JAR file when a user of the app requests it. I also need to run ProGuard on the generated JAR file. Is it possible to do this on Heroku?
We're working on exposing Heroku build infrastructure as services and what you describe is a use case that we want to support. You might be able to get something working by using or reverse-engineering heroku-push: https://github.com/ddollar/heroku-push
Here's the server-side bit that actually builds code: https://github.com/ddollar/anvil
Ryan Brainard has built a Java wrapper for Anvil: https://github.com/ryanbrainard/janvil

A good strategy for knowing the versions of deployed applications?

In order to know which revision number the application is built from, we use to give the ears we deploy to Glassfish names like myapp_2012-01-20_rev22123.ear. Then we can simply login to Glassfish and see what version is deployed in the web interface (as the appname is the name of the ear file). A downside of this approach is that we need to do a manual undeploy/redeploy to update the name...
But I would like to script the undeploy/deploy process, and having each version of an ear get a different name is not very suitable to scripting this redeployment process. Glassfish 2 does not support the "list applications" goal that Glassfish 3 has, which I could have used to retrieve the application name to undeploy.
So is there any good strategy that will easily allow us to see what version is deployed of an application, and that does not suffer from the above fault?
It would be preferable if this meant we did not have to change the existing applications (like add a jsp page or something to show the current scm revision), but a change in a Maven build script would be acceptable.
I faced a similar issue, I finally came around it by using maven-buildnumber-plugin and writing a simple servlet to get build information. You can find the details in the blog post I made.
Why not use the built-in GlassFish Server versioning to assign a version number at deploy time? This will also enable you to rollback to prior versions. For example:
asadmin deploy --name MyApplication:2012-01-20_rev22123 MyApplication.ear
There is more information on application versioning here:
http://docs.oracle.com/cd/E18930_01/html/821-2417/gihzx.html#gkhhv
Hope this helps.

how do I use web deploy to deploy multiple sites on localhost with different ports

I have a solution that contains multiple integration test projects and one web application project. each integration project connects to the web application when running the tests. I would like for each test project to access the website with its own database connection. I have been trying to use the web deploy functionality built into visual studio. However I have been unable to figure out what I need to add to either the deployment package that is created and/or the post build event for the test projects to declare the binding port for the website when deployed. For example, I want integration project A to create and access the website located at http://localhost:83 and integration project B to create and access the website located at http://localhost:82. Could someone please explain:
Is there anything I need to do the deployment package ?
What do I need to add to my post-build events for my integration projects when deploying the package, so that the website is created at the correct port when building the project?
Update:
I'm wanting to deploy the same site to two different locations on my machine so that I can run both sets of integration tests at the same time.
Update 2:
I have researched the web deploy tool and it allows you to specify parameters that modify what is deployed when you call it from the command line. However I have found the documentation very confusing. http://technet.microsoft.com/en-us/library/dd568968(WS.10).aspx
Update 3:
I expect these to be two different websites, each pointing to there own database. If possible I would like a single package that can be deployed using msdeploy. Which will then be called in a post build event from each of the integration test projects. I would like to specify the connection string and deployment location from the post build script of the integration project.
you can try with webdev.server included in visual studio. VisualStudio use this for start a webserver when you debug. With this you can start a webserver in the desire port (if the port is not used currently).
I made a bat file for change some options.
check it.
::Begin of bat file
cd C:\Program Files\Common Files\microsoft shared\DevServer\10.0\
WebDev.WebServer40.exe /port:80 /path:"C:\PATHTOYOURWEBPROJECT" /vpath:"/NAMEOFYOURWEBPROJECT"
::End of bat file
You can acces in: http://localhost:80
I use the webserver40, but if you don't have net.4 or vs2010 you can try to find webserver[ xx version].exe
I hope that this will be helpful, and sorry for my broken english.
First off, you're approaching this the wrong way.
> I would like for each test project to access the website with its
own database connection.
Who is creating the DB connection? Your web site or the test project? For rest of your question to make sense, I presume its the web site (otherwise, Project A and Project B cannot share a connection out of the box).
If your website is making the connection, unless you're caching or having a static connection, there will be a new connection made as each request runs your your site on a new thread. Another simpler alternative is to take a query param and initiate a new connection based on that. If you seed it off the caller, you can also use it for more detailed logging.
Web Deployment projects are meant for deploying to integration servers, so that means you cannot access them by http://localhost... but the full FQDN of the server.
Most importantly, http://localhost:82/myApp and http://localhost:83/myApp are two different sites (unless you redirect from one of them to another one which in itself can cause additional issues) running the same codebase.
Having said that, you would then need to deploy your website twice and then all you need is to change the config/settings entry in Project A and B to point to these to different sites.
Hope this makes sense.
You can define virtual host configuration.
Refer this guide for more information.
http://docs.jboss.org/jbossas/guides/webguide/r2/en/html/ch07.html

Resources