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

Pull out things that can be put into variables into variables #70

Closed
ksclarke opened this issue May 27, 2015 · 6 comments
Closed

Pull out things that can be put into variables into variables #70

ksclarke opened this issue May 27, 2015 · 6 comments

Comments

@ksclarke
Copy link
Contributor

Some things to variablize...

port numbers, user names, passwords, etc.

@lo5an
Copy link
Contributor

lo5an commented May 27, 2015

I need to do some of this for #22 so I was thinking about this last night.

We've got two spaces where we need variables: the Ruby script in our Vagrant file, and the various bash scripts. There's going to be some overlap, especially for things like port numbers. It looks like it's pretty easy for Ruby to make use of bash environment variables, so my inclination is to put everything in configs/variables and do something like . ./configs/variables; vagrant up to build VMs, but I'm wondering if that would be problematic for Windows folks.

@lo5an
Copy link
Contributor

lo5an commented May 28, 2015

An alternate method that might be more portable would be to do something like :

file='./configs/variables'
File.readlines(file).each do |line|
  key, value = line.split "="
  ENV[key] = value
end

Although that has the downside of breaking if we use anything other than var="literal" in the variables file.

Both of these feel kind of clunky, and I get the feeling that I'm missing some obviously better solution.

@ksclarke
Copy link
Contributor Author

I thought I'd responded here, but I guess I never clicked submit. We could write a simple little batch script to launch vagrant for Windows users (sourcing the variables from the file), but I actually assume (perhaps falsely) that anyone who'd want to build a Vagrant box, and who is stuck on Windows, would be using Cygwin or MSYS or something (where the first option would work). Perhaps that's a bad assumption on my part (I'm not a Windows user), but I can't imagine how they could function otherwise. </snarky_opinion>

But all that said, I don't have strong opinions about the two choices above -- either seems workable to me.

@lo5an
Copy link
Contributor

lo5an commented Jun 3, 2015

Just submitted PR #71 with two environment variables.

@bradspry
Copy link

Here's a link to some basic information about Vagrant and AWS; I'm wholeheartedly interested in developers having the means to generate server-class Islandora VMs for the specific purpose of load testing. I have experienced code and system failure due to high loads. Developers should be able load test their software, so they can observe how their software holds up during massive file operations.

@ruebot
Copy link
Contributor

ruebot commented Oct 1, 2015

This issue was moved to Islandora-Labs/islandora_vagrant_base_box#1

@ruebot ruebot closed this as completed Oct 1, 2015
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

4 participants