Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run the Procfile process runner with user /bin/herokuish #1147

Open
siva-vasipalli opened this issue Mar 7, 2024 · 5 comments
Open

Comments

@siva-vasipalli
Copy link

siva-vasipalli commented Mar 7, 2024

We are working on the custom ruby code execution on the rails application deploying using the Heroku build-pack. We are not able to get the expected result when we execute the below command.

/bin/herokuish procfile start runner -e $RAILS_ENV /tmp/script-$BUILD_NUMBER

####Below is the Procfile entry for the runner

# access the rails runner
runner: bundle exec rails runner

####we are getting the below response

+ /bin/herokuish procfile start runner -e development /tmp/script-194
Usage:
  rails runner [options] [<'Some.ruby(code)'> | <filename.rb> | -]

Options:
  -e, [--environment=ENVIRONMENT]  # Specifies the environment to run this runner under (test/development/production).


Examples:

Run `puts Rails.env` after loading the app:

  rails runner 'puts Rails.env'

Run the Ruby file located at `path/to/filename.rb` after loading the app:

  rails runner path/to/filename.rb

Run the Ruby script read from stdin after loading the app:
  rails runner -


You can also use the runner command as a shebang line for your executables:

  #!/usr/bin/env /app/rails runner

  Product.all.each { |p| p.price *= 2 ; p.save! }
@josegonzalez
Copy link
Member

Are you running this outside of the docker image setup?

@siva-vasipalli
Copy link
Author

Are you running this outside of the docker image setup?
@josegonzalez ....we are running the command inside of the container shell , that was created by the Jenkins Pod template.

@josegonzalez
Copy link
Member

I'm not actually sure you can combine a process start with extra arguments. You might need to just run the bundle exec thing directly.

@siva-vasipalli
Copy link
Author

@josegonzalez you mean to say...we should not include a Procfile runner process with extra arguments. We have tried running directly executing the command bundle exec rails runner also and no luck.

@josegonzalez
Copy link
Member

If you need to start arbitrary commands in the herokuish environment, start them via /exec. You could maybe set that as the entrypoint of your built image and be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants