Sourcing bashrc before run on machine executor

nodejs
circle.yml
2.0
bash
cci-20

#1

Tried following this with the machine executor:

build:
machine: true
environment:
  - CIRCLECI_USER: "circleci"
  - BASH_ENV: "/home/circleci/.bashrc"

(also tried with BASH_ENV: ~/.bashrc)

In both cases - bash commands are stuck (and timing out after 10-minute default timeout). Also I cannot SSH into the machine. Any suggestions on getting it to work?

Longer story is I want to source bashrc because I am installing node7 but it’s not getting picked up until user logs back in:

- run: circleci-install nodejs 7.10.1
- run: sudo -H -i -u ${CIRCLECI_USER} nvm alias default 7.10.1

#2

To close this, what worked eventually was piping the output into $BASH_ENV file, like suggested here:

  - run: echo 'export PATH=/opt/circleci/nodejs/v7.10.1/bin:/opt/circleci/nodejs/v7.10.1/bin:$PATH' >> $BASH_ENV

etc.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.