I need to be able to set a number of environment variables in order to configure an android development environment to gain access to physical android devices.
It is not sensible to set the PATH, ANDROID_HOME, and JAVA_HOME environment variables in repository or workspace variables as the installation of the SDK may have variance from runner to runner.
Is there are way I can get the runner to use the .zshrc or .bashrc or otherwise set runner specific variables?
If we do not have the capability our pipelines will be very brittle.
I have tried sourcing the .bashrc manually in my pipeline however I got an error:
source ~/.bashrc
bash: /root/.bashrc: No such file or directory
Strangely the HOME environment variable is not set for the runner.
This is on a linux-shell runner, version 2.4.0.
Hi Duncan,
A Linux Shell runner uses bash to run pipelines steps on your Linux machine, so it has access to the files on the host device.
It is not possible to set runner-specific variables, but you should be able to source files that exist on the host machine.
The error you get indicates that the bash cannot find the file. Does the .bashrc file exist in the /root directory on the machine where the runner is running? If not, could you try providing the path to the file in the source command?
Kind regards,
Theodora
Thanks, I think this is probably caused by my attempts to run the runner as a systemd service to auto start the runner.
I was confused as to why the ~ directory was /root since I was thinking about the working directory property of the runner command.
I've moved onto a different approach for now but I may revisit this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the update, Duncan. Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.