Open jrochkind opened 7 years ago
rake sufia:default_admin_set:create
is idempotent in current implementation at least. https://github.com/projecthydra/sufia/blob/master/app/services/sufia/admin_set_create_service.rb#L5
rake curation_concerns:workflow:load
appears to also be idempotent; goes through like 3 or 4 classes to do what it does, but appears to use AR find_or_create_by relevant attributes for each record.
See #507.
Doing this reliably is a pain, because you need fedora/solr to be running. If you are in dev, you might want the script to automatically start with solr_wrapper/fc_repo_wrapper, if they aren't already running. But if you are in production -- and you might want to setup a new machine in production like this -- then you can't use the wrappers.
Hmm, I might just make a dev:setup
rake task that tries to all of this, that you only run in dev. In production you're still on your own -- but our capistrano task handles these things anyway in production, so you're good.
I might also leave this for later, not urgent right now.
Ways to check in code if solr and fedora are running:
See #507
rake curation_concerns:workflow:load
andrake sufia:default_admin_set:create
, not sure if they're idempotent, not sure if./bin/setup
is usually idempotent.I made the ticket @hackmastera