-
-
Save asolera/deb5f342f8ac3c332abebcc6127b6cb9 to your computer and use it in GitHub Desktop.
Vagrant with dot env without plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXAMPLE_ENV_A=Hello | |
EXAMPLE_ENV_B=world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /home/myapp | |
export $(echo $(cat .env | sed 's/^#.*//g' | sed 's/\r//g' | xargs) | envsubst) | |
echo "Loaded env configs:" | |
echo $EXAMPLE_ENV_A | |
echo $EXAMPLE_ENV_B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.define "host" do |app| | |
app.vm.network "private_network", type: "dhcp" | |
app.vm.hostname = "host" | |
app.vm.synced_folder ".", "/home/myapp", type: "virtualbox" | |
app.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
v.cpus = 1 | |
end | |
end | |
config.vm.provision "shell" do |s| | |
s.path = "bootstrap.sh" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment