Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Add support for both GA and updated packs #53

Merged
merged 1 commit into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions apim-is-as-km-with-analytics/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ require 'uri'
require 'erb'

# check whether the command is 'vagrant up'
if ARGV[0] == 'up'
if ARGV[0] == '--updates'
print "Please insert your WSO2 credentials\n"
print "Username: "
USERNAME = STDIN.gets.chomp
print "Password: "
PASSWORD = STDIN.noecho(&:gets).chomp
print "\n"
# generate TOKEN
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':')
else
# initializing USERNAME and PASSWORD
print "Using the Vagrant boxes with no updates...\n"
USERNAME = ""
PASSWORD = ""
end

# generate TOKEN
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':')

FILES_PATH = "./"
DEFAULT_MOUNT = "/home/vagrant/"
# load server configurations from YAML file
Expand All @@ -51,15 +51,23 @@ Vagrant.configure(2) do |config|
# define the virtual machine configurations
config.vm.define server['hostname'] do |server_config|
# define the base Vagrant box to be used
server_config.vm.box = server['box']
if ARGV[0] == '--updates'
server_config.vm.box = server['box']
else
server_config.vm.box = "wso2/" + server['box']
end

# define the virtual machine host name
server_config.vm.host_name = server['hostname']

# Diasbling the synched folder
server_config.vm.synced_folder ".", "/vagrant", disabled: true

#generate the url
url = "https://"+TOKEN+"@vagrant.wso2.com/boxes/"+server['box']+".box"
if ARGV[0] == '--updates'
#generate the url
url = "https://"+TOKEN+"@vagrant.wso2.com/boxes/" + server['box'] + ".box"
else
url = "https://vagrantcloud.com/wso2/" + server['box']
end

server_config.vm.box_url = url

Expand Down
24 changes: 16 additions & 8 deletions apim-with-analytics/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ require 'uri'
require 'erb'

# check whether the command is 'vagrant up'
if ARGV[0] == 'up'
if ARGV[0] == '--updates'
print "Please insert your WSO2 credentials\n"
print "Username: "
USERNAME = STDIN.gets.chomp
print "Password: "
PASSWORD = STDIN.noecho(&:gets).chomp
print "\n"
# generate TOKEN
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':')
else
# initializing USERNAME and PASSWORD
print "Using the Vagrant boxes with no updates...\n"
USERNAME = ""
PASSWORD = ""
end

# generate TOKEN
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':')

FILES_PATH = "./"
DEFAULT_MOUNT = "/home/vagrant/"
# load server configurations from YAML file
Expand All @@ -51,15 +51,23 @@ Vagrant.configure(2) do |config|
# define the virtual machine configurations
config.vm.define server['hostname'] do |server_config|
# define the base Vagrant box to be used
server_config.vm.box = server['box']
if ARGV[0] == '--updates'
server_config.vm.box = server['box']
else
server_config.vm.box = "wso2/" + server['box']
end

# define the virtual machine host name
server_config.vm.host_name = server['hostname']

# Diasbling the synched folder
server_config.vm.synced_folder ".", "/vagrant", disabled: true

#generate the url
url = "https://"+TOKEN+"@vagrant.wso2.com/boxes/"+server['box']+".box"
if ARGV[0] == '--updates'
#generate the url
url = "https://"+TOKEN+"@vagrant.wso2.com/boxes/" + server['box'] + ".box"
else
url = "https://vagrantcloud.com/wso2/" + server['box']
end

server_config.vm.box_url = url

Expand Down