-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
53 lines (48 loc) · 1.55 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provision :docker
config.vm.provision :shell,
keep_color: true,
privileged: false,
run: "always",
inline: $install_tools
end
$install_tools = <<SCRIPT
echo Installing docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo Installing terraform onto machine...
mkdir -p $HOME/bin
sudo apt-get update && sudo apt-get install -y unzip jq
pushd $HOME/bin
wget -q https://releases.hashicorp.com/terraform/1.0.7/terraform_1.0.7_linux_amd64.zip
unzip -q -o terraform_1.0.7_linux_amd64.zip
. ~/.profile
popd
pushd /vagrant
docker build ./services/account -t form3tech-oss/platformtest-account
docker build ./services/gateway -t form3tech-oss/platformtest-gateway
docker build ./services/payment -t form3tech-oss/platformtest-payment
docker-compose up -d
popd
echo Applying terraform script
pushd /vagrant/tf/development
terraform init -upgrade
terraform apply -auto-approve
popd
pushd /vagrant/tf/staging
terraform init -upgrade
terraform apply -auto-approve
popd
pushd /vagrant/tf/production
terraform init -upgrade
terraform apply -auto-approve
popd
set -x
SCRIPT