Open mikeymicrophone opened 5 years ago
Follow these steps to prepare your development environment.
config/environments/development.rb
into a file named development_ENV_CODE_WORD.rb
, where you use your environment code word as that second part. So, for instance, a possible filename would be developent_orchard.rb
.EDITOR=vi rails env_credentials:edit -e development_orchard
In place of 'orchard', use your code word. This will create config/credentials-development_orchard.yml.enc
and /config/master-development_orchard.key
, while adding the latter to .gitignore
. You should replace the contents of the file you are editing with the credentials shown in the comment above this.
config/database.yml
and add a db configuration for your environment. Postgresql is strongly recommended. If that platform isn't plausible for you, be aware that it may interfere with your ability to contribute. However, you are welcome to try.RAILS_ENV=development_orchard rails db:create
RAILS_ENV=development_orchard rails db:migrate
where, again, 'orchard' should be replaced with your code word.
One way to select the environment would be to use a local .bashrc
file that only sets the value while you are in that directory (I am assuming you don't want to use this Rails env systemwide because you probably have other Rails projects that you'd just run in development mode).
Here's one way to do so. It adds a rule to your systemwide .bashrc
that repeatedly scans your other directories for local .bashrc
s when you move into a new directory.
https://superuser.com/questions/915703/is-there-a-folder-specific-bashrc-or-bash-profile/915761#915761
Here's another way.
https://www.pmg.com/blog/how-to-set-up-directory-specific-bash-or-other-shell-environments/
Another option would be to set a systemwide environment variable for COMMISSULATOR_ENVIRONMENT and then make Rails load from that, or copy its value to RAILS_ENV.
In terms of credentials that are really necessary, I'm not seeing much. I think Rollbar will be important if we want to view our own errors instead of theirs. I tentatively like the idea of using Rollbar in development so I can jump into the details of the ongoing dev process.
I used AWS to create a policy that has access to just one bucket. We'll see if that worked.
Commissulator uses the gem
rails-env-credentials
to enable storage of auth tokens in per-environment encrypted files which are committed to the repo. To decrypt a set of credentials, a master key for that environment would have to be shared (NOT via the repo).It would, most likely, be plausible to share the development environment's key. One reason for not doing so is that the data set of clients, deals, and agents is expected to be mirrored in both Commissulator and Follow Up Boss. If that account was shared with 5 developers, then each one might have local agents and clients the others didn't have. Those would be pushed to Follow Up Boss, and then the other developers would be accessing a FUB account that included data not in their local environments. That might not cause any actual problems, and it might actually carry lots of benefits for expedient development, but at this juncture we're going to experiment with using separate development environments, mostly to see how well it will work.
Begin by copying the file config/environments/development.rb into a new file in that same directory (you could name it development-cire.rb or something such as that). This can be committed to the repo although in the future it might be pertinent to use gitignore on such files. You will then use rails-env-credentials to generate your credential file and its master key as described here. https://github.com/sinsoku/rails-env-credentials#other-environments-support
Edit the credentials file so it looks like so.
Then commit the environment file and the credential file to a branch on your fork of the repo. Send me the master key via iMessage and I'll update the file with the credentials you'll need to get the app running.