0

I have couple of bash functions I'd like to be automatically available in all bash environments on my Jenkins instance. I defined this in .bashrc file of the Jenkins user:

test () {
  echo "Hello World!"
}

And I'd like it to be availble in all Jenkins jobs running in bash

#!/bin/bash
test

<rest of the script>
mwas01
  • 13
  • 2
  • relevant: https://stackoverflow.com/questions/42867510/can-jenkins-source-bashrc-of-associated-user – logical x 2 Aug 06 '21 at 09:09
  • 1
    I always live by the philosophy to make every jenkins job just being a thin wrapper around a bash script that just gets called (has the advantage that its easy to run in the shell on your own once you have to debug something). You can then source whatever profile you want to use from there ... Maybe putting `source ~/.bashrc ` on the top of your jenkins jobs could be a good workaround? – logical x 2 Aug 06 '21 at 09:11

0 Answers0