cat command says,"No such file or directory" if its on CircleCI

Viewed 30

When I deploy my Ruby on Rails project, I restart puma sending -SIGUSR2 to puma process.

kill -SIGUSR2 `(cat /home/xxxxxx/tmp/pids/server.pid)`

However if its on circleci command, it always return

cat: /home/*****************/tmp/pids/server.pid: No such file or directory

Here is part of circleci code


      - run:
          name: Start ssh-keyscan
          command: |
            ssh-keyscan ${PRODUCTION_HOST} >> ~/.ssh/known_hosts
      - deploy:
          name: Start deploy
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
                ssh -o StrictHostKeyChecking=no ${USER_NAME}@${PRODUCTION_HOST} "
                cd /home/www.example.com/htdocs/;
                git pull origin master;
                /home/www.example.com/.rbenv/shims/bundle install;
                export NODE_OPTIONS=--openssl-legacy-provider;
                RAILS_ENV=production /home/www.example.com/.rbenv/shims/bundle exec rake assets:clobber;
                RAILS_ENV=production /home/www.example.com/.rbenv/shims/bundle exec rake assets:precompile;
                RAILS_ENV=production /home/www.example.com/.rbenv/shims/bundle exec rails db:migrate;
                kill -SIGUSR2 `(cat /home/www.example.com/htdocs/tmp/pids/server.pid)`;"
            fi

I don't see any difference between ssh and ssh on circleci. Does someone know why it happens, and how I can find files on CircleCi?

0 Answers
Related