Search code examples
gitjenkinsclearcasetcsh

Running a Git build inside a ClearCase View in tcsh


I have a project stored in git that must be built outside of clearcase and then executed inside of a Clearcase view. All of the builds and execution must be done inside of tcsh due to restrictions on external scripts.

The Clearcase view requires tcsh to successfully execute the commands.

To automate this process, I would like to use jenkins.

How is this possible?


Solution

  • I figured this out and wanted to record it somewhere.

    To execute a different shell inside of the Execute shell build step in jenkins, I use the following script:

    #!/usr/bin/tcsh -xF
    source env.csh
    make
    echo DONE
    

    NOTE: a newline is required at the end of each script to make sure that the last command is executed. I usually just echo DONE to make sure that every step is executed.

    To run commands inside of the Clearcase view in `tcsh``, I use the following script:

    #!/usr/bin/tcsh -xF
    setenv SHELL /bin/tcsh
    cleartool setview -login -exec "command 1; command 2; command 3" view_tag
    echo DONE
    

    Hope this helps!