LoginSignup
3
2

More than 5 years have passed since last update.

Vagrant プロビジョニングで環境変数を設定する

Last updated at Posted at 2016-06-29
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  FOO = "foo"
  BAR = "bar"

  config.vm.provision :shell do |s|
    s.name = 'foobar'
    s.env = {:FOO => FOO, :BAR => BAR}
    s.path = "foobar.sh"
  end

end

foobar.sh
#!/bin/sh
set -eu

echo "FOO: $FOO"
echo "BAR: $BAR"

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2