Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

Comments

You can definitely use scripts on Linux. But what is your exact question?



One answer

Permanent link
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.

0 votes

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.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,014

Question asked: May 16 '14, 11:13 a.m.

Question was seen: 4,816 times

Last updated: May 20 '14, 7:50 a.m.

Confirmation Cancel Confirm