forked from rook/rook
Merge pull request #321 from travisn/vagrant-local-build
load a local build into vagrant based on env var
This commit is contained in:
Vendored
+23
-4
@@ -26,10 +26,23 @@ require 'open-uri'
|
||||
if File.exists?('.discovery-token')
|
||||
token = IO.readlines(".discovery-token")[0..-1].join
|
||||
else
|
||||
token = open($new_discovery_url).read
|
||||
discovery_token = open($new_discovery_url).read
|
||||
File.open(".discovery-token", 'w') { |file| file.write("#{token}") }
|
||||
end
|
||||
|
||||
private_build = false
|
||||
if ENV["START_LOCAL_ROOKD"] == "1"
|
||||
private_build = true
|
||||
end
|
||||
|
||||
if private_build
|
||||
aci_location = "/release/quay.io-rook-rookd-dev.aci"
|
||||
aci_options = "--insecure-options=image"
|
||||
else
|
||||
aci_location = "quay.io/rook/rookd:latest"
|
||||
aci_options = ""
|
||||
end
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
set_coreos_box(config, $channel)
|
||||
|
||||
@@ -40,11 +53,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
|
||||
attach_volumes(node, $node_disks, $disk_size)
|
||||
|
||||
# enable if you want to run for locally build ACI files
|
||||
#node.vm.synced_folder "../../release", "/release", id: "release", :nfs => true, :mount_options => ['nolock,vers=3,tcp']
|
||||
if private_build
|
||||
# run locally built ACI files
|
||||
node.vm.synced_folder "../../release", "/release", id: "release", :nfs => true, :mount_options => ['nolock,vers=3,tcp']
|
||||
end
|
||||
|
||||
node.vm.provision :cloud_config, :template => "cloud-config.yml.in",
|
||||
:subst => { "%%token%%" => "#{token}" }
|
||||
:subst => {
|
||||
"%%discovery_token%%" => "#{discovery_token}",
|
||||
"%%aci_location%%" => "#{aci_location}",
|
||||
"%%aci_options%%" => "#{aci_options}"
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,13 +7,6 @@ coreos:
|
||||
- name: rookd.service
|
||||
enable: true
|
||||
command: start
|
||||
# enable if you want to run from locally built ACI files
|
||||
# drop-ins:
|
||||
# - name: 10-local-aci.conf
|
||||
# content: |
|
||||
# [Service]
|
||||
# Environment=ROOKD_ACI=/release/quay.io-rook-rookd-dev.aci
|
||||
# Environment=RKT_OPTIONS=--insecure-options=image
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Rook Daemon - software defined storage
|
||||
@@ -25,11 +18,12 @@ coreos:
|
||||
Restart=always
|
||||
KillMode=process
|
||||
|
||||
Environment=ROOKD_ACI=quay.io/rook/rookd:latest
|
||||
Environment=RKT_OPTIONS=%%aci_options%%
|
||||
Environment=ROOKD_ACI=%%aci_location%%
|
||||
Environment=ROOKD_PUBLIC_IPV4=$public_ipv4
|
||||
Environment=ROOKD_PRIVATE_IPV4=$private_ipv4
|
||||
Environment=ROOKD_DATA_DIR=/var/lib/rook
|
||||
Environment=ROOKD_DISCOVERY_URL=%%token%%
|
||||
Environment=ROOKD_DISCOVERY_URL=%%discovery_token%%
|
||||
Environment=ROOKD_DATA_DEVICES=sda,sdb,sdc,sdd
|
||||
|
||||
ExecStartPre=/usr/bin/mkdir -p ${ROOKD_DATA_DIR}
|
||||
|
||||
Reference in New Issue
Block a user