Error when attempting to deploy a WAR to Glassfish 3 using an Ant Build Script - deployment

I am investigating how to use both Glassfish and Ant buildfiles. I've written a build script (for the first time) which will create a WAR file of my basic Hello World app.
I am then trying to deploy this WAR to Glassfish as part of the build script. I found details of the glassfish-deploy task and have managed to get this included in the build script after including the ant-task jar file in the class path.
However, when I run the script I get the message:
[glassfish-deploy] Install Directory of application server not known. Specify either the installDir attribute or the asinstall.dir property
I've tried to find out what is meant by this, but can find no reference to either the installDir attribute or the asinstall.dir property. I have managed to deploy the created WAR file through Glassfish's admin webpage but I cannot seem to get this Ant script to do it successfully.
Any pointers or guidance would be most helpful.

OKay after a lightbulb moment I managed to resolve this by editing the task in my build script so it is now <glassfish-deploy file="${name}.war" installDir="C:\\glassfish3\\glassfish" force="true"/>
As it appears that the ant script does not know where Glassfish is installed. This resolves the issue and the script runs (and workds) However the next stage is to figure out how to do this without having to hardcode the location into into the build script. Especially if I want to write a script that can deploy the WAR file to a remote server.

Related

Using Microsoft.Data.SqlClient in PowerShell

I would like to use the Microsoft.Data.SqlClient namespace/ objects in a PowerShell script.
Two (click1, click2) Github posts provide a way to load the correct dll's, but the solutions don't seem to work anymore.
E.g. result of the first solution while copying the next files:
(Packages copied from .nuget/packages folder)
Microsoft.Data.SqlClient.dll
Microsoft.Data.SqlClient.SNI.x64.dll
Microsoft.Identity.Client.dll
Result: Could not load file or assembly 'System.Runtime, Version=6.0.0.0'
In addition, I've tried to create a Dummy Console App -> Added the Microsoft.Data.SqlClient Nuget package -> built the project and copied all dll's to the same folder as the PS script.
As soon as I start the script (using the 'Add-Type -Path' construction), it results in errors, such as 'couldn't load file or assembly - wrong version...' (this is strange, because the folder contains all dll's...)
Could you provide an alternative solution/ steps in order to use the described package in a PS script?

Rundeck is not generating service.log

One of my colleague is trying to install rundeck on a windows 10 OS. We have both followed the documentation guide on Rundeck's website. I was able to run and install Rundeck as a service but my colleague is stuck on the part where we need to run start_rundeck.bat because his Rundeck is not generating service.log. He can access the Rundeck UI but the logs are still not generating. Anyone knows how to fix this issue? Thanks!
Your colleague just needs to follow the instructions carefully.
Let me clarify the first steps focused on redirecting the standard output to the service.log file, I recreated the Rundeck installation on my Windows virtual machine:
First, check the minimal requirements. Rundeck needs OpenJDK 11 as the main dependency to work. You can obtain it from here, this implementation also works.
Create a new directory where the Rundeck .war file must be saved, e.g: C:\rundeck.
Go to this page and download .war file on the directory created in the previous step.
Open a new PowerShell terminal and set the Rundeck base directory: set RDECK_BASE=C:\rundeck.
Launch Rundeck for the first time to generate all files: java -jar rundeck-3.4.6-20211110.war (inside the directory created in the second step), wait until the Grails application running at http://localhost:4440 message appear, then stop the instance with ctrl + c key combination.
With any text editor, create a new file at C:\rundeck\ path called start_rundeck.bat with the following content:
set CURDIR=%~dp0
call %CURDIR%etc\profile.bat
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -jar rundeck-3.4.6-20211110.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
And save it.
Go to the PowerShell terminal and just run the start_rundeck.bat file with .\start_rundeck.bat.
Now check the C:\rundeck\var\logs\service.log file.
At this point, it's possible to continue with the next steps: Configure Rundeck as a service using the nssm.exe program.

How To Run Robot Framework Project Developed In Eclipse Via Command Line

I have created a project using Robot Framework in Eclipse via RED. I want to know how can I run this project via Windows Command Line, so that I can create a Jenkins job to run it at a particular time ? I have tried using the steps for running Eclipse Project from command line via Debug mode, but it is not helping.
Please find the project structure below
I also tried to reach this location and run this test suit using the command
Robot Test_Suite.robot, but then I'm getting below 2 errors
1.) Importing test library 'Excel_Library' failed: ImportError: No module named Excel_Library. This file is a python file which I have written to support Excel operations and it is present at below location in the project -
2.) No Such File Or Directory - Path_To_External_Input\\External_Inputs.xls
This file contains the input which is being read before performing operations related to test suite and it is present at below location -
Do I need to add those in the command line if so how to take care of that ? This project run smoothly from eclipse but only problem is coming from command line.
It seems that you are able to run robot correctly, although I would prefer lowercase R with robot command.
1) I think you have misspelled the library name. If it's a pip package, try ExcelLibrary instead, and check that you have installed it by pip list command or equivalent.
2) Please check the path. Without additional info on how and where the file is called and where the file is located are needed.

Any way to run commands/script after VS2015 Publish wizard has copied files to output?

I have a very simple Windows service project I want to deploy to a server using Visual Studio 2015. I can successfully deploy using the Publish wizard (right-click on project -> Publish and deploy to \\myserver\c$\somepath\), but I need to 1) stop the service before publishing (so that the executable can be replaced), and 2) restart the service after the files have been copied.
I know how to start/stop services from the command line, and this answer provides a way to do it directly in a build action. However, I can't seem to find a way to execute any action after VS has copied the files to the output directory on the server.
For example, I have tried adding the following to my .csproj file without luck:
<Target Name="Mytarget" AfterTargets="AfterPublish">
<Warning Text="After AfterPublish" />
</Target>
Mytarget executes before VS actually copies the files to the server, so evidently, I can't hook onto AfterPublish. I've also tried PipelinePreDeployCopyAllFilesToOneFolder, CopyAllFilesToSingleFolderForPackage, and MSDeployPublish without luck (these don't seem to execute at all).
My end goal is to allow more-or-less one-click updating of the service, without having to log on to remote desktop and run a script manually after each update.
Is there any way I can have VS automatically execute an action after publishing a Windows service project to a server?

Building .car ColdFusion Archive from command-line

The current way I'm packaging my application is to deploy it on a running ColdFusion server, and export is as a .car (Coldfusion ARchive) through the admin console, but this manual process is usually prone to errors.
That's why I'm looking for a tool (or any solution) to build this final .car from the command line (so without requiring a ColdFusion server up and running).
Note: because of the complexity and the size of this legacy application, I cannot work with .war files, and I'm not aware of any other packaging format than .war or .car for ColdFusion applications.
Hi unfortunately Coldfusion is not built to use in this way but you can use API or the admin console.
I invite you to read this page : http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf3638e6-7fc5.html for more details.
From coldfusion 9 servers, CAR files are zip files. You can unzip them, edit the files, and zip them back up and deploy them on coldfusion10 servers. The zip contains a folder called "{WorkingDir}" with curly brackets.
Structure looks like
{WorkingDir}
server_settings.xml
archive_settings.xml