Capistrano build script using Ant - ant

I have a PHP app I've been deploying with Capistrano for a while now. I'd like to compress js and css locally and perform other cleanup tasks before deploying to the server. I currently use build_script to make an Ant call:
set :build_script, "ant compress -q"
I'm not sure if this is limited to Windows, but my partial output looks like:
executing locally: ant compress -q
{$HOME}\AppData\Local\Temp\20120826020126>/*
'/*' is not recognized as an internal or external command,
operable program or batch file.
{$HOME}\AppData\Local\Temp\20120826020126>Licensed to the Apache Software Foundation (ASF) under one or more
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
{$HOME}\AppData\Local\Temp\20120826020126>contributor license agreements. See the NOTICE file distributed with
'contributor' is not recognized as an internal or external command,
operable program or batch file.
{$HOME}\AppData\Local\Temp\20120826020126>this work for additional information regarding copyright ownership.
'this' is not recognized as an internal or external command,
operable program or batch file.
{$HOME}\AppData\Local\Temp\20120826020126>The ASF licenses this file to You under the Apache License, Version 2.0
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.
Is there any way to suppress all output from Ant, or at least get Capistrano not to pass any output from my build script to the command line?

I found the answer on both SuperUser and StackOverflow.
set :build_script, "ant compress -q > NUL"

Related

Unable to export Tibco Jasper Reports

Currently we are on Jasper Reports 6.3. We have upgraded our Report Center to Jasper 7.9
For migrating the custom reports and everything inside the Jasper RC to the new Jasper 7.9 server , I am using the following command
.\js-export.bat --everything --output-zip W:\JRS_Export__JRS.zip
I am inside the buildomatic folder where ant and js-export.bat are present. But when I try and execute the below command, I get the following error
C:\JRS\Instances<customer_folder>\buildomatic> .\js-export.bat --everything --output-zip W:\JRS_Export_SDLWSDEV_JRS.zip
Writing to log file: logs/js-"export"-"pro"___18701.log
Bundled Ant not found. Using system Ant.
Running "validate-keystore" Ant task
'ant' is not recognized as an internal or external command,
operable program or batch file.
Checking Ant return code: BAD (1)
I tried to search the community page, but was unable to find the appropriate answer.
Could anyone please help?

"javac is not recognised" after setting the path

I already set the path in advanced settings. but when i compile a program it says
javac is not recognised.. 'javac' is not recognized as an internal or
external command, operable program or batch file.

Unable to run MiniZinc from command line - Even after adding installation location to PATH

Initially, I had the error: minizinc is not recognized as an internal or external command, operable program or batch file. when running minizinc mzn-cbc model.mzn data.mzn in the Git CMD.
Later on, following the instructions found at https://github.com/MiniZinc/libminizinc/issues/213 with suggestions from https://groups.google.com/forum/#!topic/minizinc/IFpUM_TSNGU, I did: export PATH=$PATH:{MINIZINC} where {MINIZINC} is the installation location. However, my terminal returned the error: 'export' is not recognized as an internal or external command, operable program or batch file. This also happens when I tried running the above with the windows command prompt..
Is there a way to go about solving this?
If it helps, the folder in which MiniZinc is installed looks something like this on my computer:
I'm afraid the instruction given in the GitHub issue only works within bash and derived shells. By default Windows uses batch instead. To change the PATH system variable, which is what it is called on Windows, you need to take different steps. They are explained here: https://java.com/en/download/help/path.xml

Make a script executable in bin directory ant

Here is my ant script that wants to convert the script to executable from a zip. Here is what I do:
unzip a .zip file,
store to temp directory
run the script 'pkg' with a argument validate
<chmod dir="tmp/temp/test/bin" perm="ugo+rx" includes="**/*" />
<echo message="Making scripts exec: tmp/temp/test/bin" />
<exec executable="/bin/bash">
<arg value="tmp/temp/test/bin/pkg"/>
<arg value="validate"/>
</exec>
This does not make the script executable and instead gives this error:
Execute failed: java.io.IOException: Cannot run program "D:\tmp\temp\test\bin": CreateProcess error=5, Access is denied.
Cannot run program "D:\tmp\temp\test\bin": CreateProcess error=5, Access is denied.
Are you running this under Windows or Linux/Unix/MacOS?
Windows doesn't have the concept of executability in a file. Instead, it associates file suffixes with executable programs. For example, I could associate the .py suffix to be associated with the python.exe program. Opening foo.py will run that Python script under the Python executable. Change the name to foo.pl, and either the script won't run, or if you've associated .pl with perl.exe, will run the script under Perl.
You can add the suffix of your script to the %PATHEXT% environment variable which will allow you to type the file name sans extension. For example, if I added .py to %PATHEXT%, and I type in foo into the command line terminal, Windows may look for foo.py and then execute that. (unless it finds foo.exe or foo.bat first. Then those would execute).
The <chmod> task does nothing under Windows. In the <chmod> man page, it states:
Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix or NonStop Kernel (Tandem).
Also, not all Zip implementations can store file permission and ownership information -- especially Unix style permissions and ownership. Some can, and some can't. Even if you somehow want to express the file's executability for Unix systems, it may not work.
What I recommend is to include a <condition> test in your script to test for the OS. Then, you can separate what to do if you're on Linux/Windows/MacOS and what you want to do on a Windows system.

What does"'vi' is not recognized as an internal or external command, operable program or batch file." mean?

While sending a mail using mutt in windows I got the error saying:
'vi' is not recognized as an internal or external command,
operable program or batch file.
How to debug that error.
I have already installed Cygwin with the VI editor package.But it doesn't seem to be working!!
This error message generally means the vi executable file was not found in any of the folder locations defined in the PATH environment variable.
To fix this find the folder location of the vi executable file and add it to the PATH.
More specifically, your PATH environment variable is missing "C:\cygwin\bin" directory, but this answer assumes you accepted the Cygwin installation default location. If you can not find the problem, simply re-install Cygwin to the same location on disk and then carefully review all of the questions asked before accepting defaults.
The Title of this question omits Cygwin, so Google treats it like a generic vi pathing issue, sending Powershell users to this page as well.
If you just want VI working in Powershell, I don't suggest Cygwin these days. Instead:
Install Chocolatey https://chocolatey.org/install
Open Powershell AS Administrator
chocolatey.exe install vim
Technically Chocolatey is not required - you could get vim from the vim website. But chocolatey will make easier work of the install, including offering other UNIX utilities.

Resources