Automated Setup

Hi all, I’m trying to fully automate my setup and would like to see if there’s a way to do a command line interface to create the first user and make them an admin without use the web interface and the CLI. Benjamin pointed me towards ruby runner, (appreciated!) but am not a developer so not sure where to start.
Has anyone come up with an easy way to automate these two steps?

On the FAQ for pod maintainers, there’s a topic that says “Make yourself an admin”. That gives the command syntax. Assuming you know that is the email address of your pod administrator, then you can use these two commands. (perhaps more verbose than is strictly required)

echo "Role.add_admin User.where(email: \"${PODMIN}\").first.person" | \
   RAILS_ENV=production bundle exec rails console

You can see I’m a bash hack, and no ruby expert. :slight_smile: Presumably there’s a more Rubyesque way to do it, though I think that will get the job done.

1 Like