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

Commit

Permalink
Add support for both GA and updated packs
Browse files Browse the repository at this point in the history
  • Loading branch information
VimukthiPerera authored and KavinduZoysa committed Oct 9, 2018
1 parent 4399c91 commit f4e6a85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

In order to use Vagrant boxes, you will need an active subscription from WSO2 since the Vagrant boxes hosted at vagrant.wso2.com contains the latest updates and fixes to WSO2 Identity Server. You can sign up for a Free Trial Subscription [here](https://wso2.com/free-trial-subscription).

If you wish to use the Vagrant boxes without updates, please build them from [here](https://github.com/wso2/vagrant-boxes).

This section defines the procedure to execute Vagrant resources for a setup of WSO2 Identity Server single
node with Analytics support.<br>

Expand Down Expand Up @@ -32,9 +30,15 @@ cd vagrant-is
3. Spawn up the Vagrant setup.

```
vagrant --updates up
```
If you wish to use the Vagrant boxes without updates, spawn up the Vagrant setup.

```
vagrant up
```

4. Access the Identity Server and Identity Server Analytics via the URLs given below.

```
Expand Down
26 changes: 16 additions & 10 deletions 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,17 +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']

server_config.vm.box_check_update = true

# 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

0 comments on commit f4e6a85

Please sign in to comment.