Passing multiple commands to Command Line Build RTC 4.0.4 with Linux JBE
I have a command line build that works fine with a script, but I would like to possibly preprocess using a Linux command. So, for this example I want to invoke sed on the script, for instance:
/bin/sed 's/\r//g' buildscript.sh | /bin/sh
or to accomplish the same thing:
dos2unix buildscript.sh; ./buildscript.sh
While this is just a simple case of converting the Windows line endings to Unix/Linux line endings there might be other things we may want to do on the build definition command line.
We do not use eclipse projects on our project, but our developers use either Linux or Windows for the RTC client.
/bin/sed 's/\r//g' buildscript.sh | /bin/sh
or to accomplish the same thing:
dos2unix buildscript.sh; ./buildscript.sh
While this is just a simple case of converting the Windows line endings to Unix/Linux line endings there might be other things we may want to do on the build definition command line.
We do not use eclipse projects on our project, but our developers use either Linux or Windows for the RTC client.
One answer
The problem is that windows users can cause the script to have Windows line engings (eg. CRLF). The CR will prevent BASH from executing the script.
The issue is the command line build. We use a script to do a maven build and perform some post-build tasks. The best solution I could think of is to use sed to eliminate the CRs and pipe it into bash (or sh). But the command-line build definition command line just ends up passing the pipe (or semicolon in the second example) to the first command.
There are other solutions, such as using the project explorer, but that does not ensure that the script will always have Linux line endings.
This is a minor issue since the developers who use Windows can also use some discipline.
The issue is the command line build. We use a script to do a maven build and perform some post-build tasks. The best solution I could think of is to use sed to eliminate the CRs and pipe it into bash (or sh). But the command-line build definition command line just ends up passing the pipe (or semicolon in the second example) to the first command.
There are other solutions, such as using the project explorer, but that does not ensure that the script will always have Linux line endings.
This is a minor issue since the developers who use Windows can also use some discipline.
Comments
I did the test in my RTC 4.0.6. I don't think the JBE Command Line build can accept multiple commands.
For the Linux build, maybe you need another shell script to convert the file format and call the build script. You can even put the script on the build directory of the Linux build server.
Thanks Lily,
It is a minor issue and a simple workaround. One possibility would be to use a Python script. I don't think the Python interpreter would have a problem.
Comments
Donald Nong
May 18 '14, 8:34 p.m.You can definitely use scripts on Linux. But what is your exact question?