How to execute commend like mv, cp etc. which config file placed in outside

Hi, I have a problem with config.yml which all config it’s been doing normally. The problem is mv and cp commend can’t point to right location to do process. Let me explain my project structure

---- .circleci/
---------- config.yml
---- project_name/
---------- model/
---------- controller/
---------- config/
---------- view/
---------- Gemfile

and a pieces of config that has problem

steps: 
  - checkout

  - run: mv /project_name/config/sidekiq.yml.example /project_name/config/sidekiq.yml
  - run: cp /project_name/config/settings/test.yml /project_name/config/settings/staging.yml

  #Which version of bundler?
  - run:
      name: Which bundler?
      command: bundle -v

As you see I attempted to use mv and cp which pointed direct to folder name and files but I got error no directory and files. How I do config CI with folder like this?

You just need to know the sub-directory that checkout uses. By default I believe it is /app, starting at the root of the container’s file system. So your paths would be /app/project_name/....

Thank you,
It’s work for me but I have other problem with commend execution because Gemfile’s location in the project_name folder

  - run:
      name: Bundle Install
      command: bundle check || bundle install

Do I need cd project_name && bundle check || cd project_name && bundle install or circleci has another way to do

Why not try that and see if it works? :grin:

1 Like

I think it work but it would be nice if they have another way to do that not only cd

Probably not, it’s too specific to your use case. If you find the Bash syntax too verbose in your YAML, you can commit a shell script and then specify that in your YAML instead.

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