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

Commit

Permalink
Merge pull request #18 from VimukthiPerera/master
Browse files Browse the repository at this point in the history
fix synced folder issue
  • Loading branch information
DilanUA authored Mar 20, 2018
2 parents b3a7f3a + 314ec90 commit ddbeeab
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ for MySQL, [Connector/J](https://dev.mysql.com/downloads/connector/j/5.1.html).
1. Checkout this repository into your local machine using the following Git command.

```
git clone https://github.com/wso2/vagrant-is.git
git clone https://github.com/wso2/vagrant-is.git
```
>If you are to try out an already released zip of this repo, please ignore this 1st step.
2. Move to `vagrant-is` folder.

```
cd vagrant-is
cd vagrant-is
```
>If you are to try out an already released zip of this repo, please ignore this 2nd step also. Instead, extract the zip file and directly browse to `vagrant-is-<released-version>` folder.
>If you are to try out an already released tag, after executing 2nd step, checkout the relevant tag, i.e. for example: <br> git checkout tags/v5.4.1.4 and continue below steps.
3. Spawn up the Vagrant setup.

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

```
For Identity Server - https://localhost:9443/carbon
For Identity Server Analytics - https://localhost:9444/carbon
```
For Identity Server - https://localhost:9443/carbon
For Identity Server Analytics - https://localhost:9444/carbon
6 changes: 5 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $stdout.print "password: "
PASSWORD = $stdin.noecho(&:gets).chomp
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':')

FILES_PATH = "./"
DEFAULT_MOUNT = "/home/vagrant/"
# load server configurations from YAML file
CONFIGURATIONS = YAML.load_file('config.yaml')
Vagrant.configure(2) do |config|
Expand Down Expand Up @@ -72,7 +74,9 @@ Vagrant.configure(2) do |config|
vb.customize ['modifyvm', :id, '--memory', memory]
vb.customize ['modifyvm', :id, '--cpus', cpu]
end

if server['conf_dir']
server_config.vm.provision "file", source: FILES_PATH + server['conf_dir'], destination: DEFAULT_MOUNT + server['conf_dir']
end
# configure shell provisioner
if !server['provisioner_script']
# if not defined, move to next server specification
Expand Down
3 changes: 3 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ servers:
ram: 2048
cpu: 1
provisioner_script: mysql/provisioner/db_provisioner.sh
conf_dir: mysql/scripts
-
hostname: identity-server
box: wso2is
Expand All @@ -30,6 +31,7 @@ servers:
ram: 2048
cpu: 1
provisioner_script: identity-server/provisioner/product_provisioner.sh
conf_dir: identity-server/confs
-
hostname: identity-server-analytics
box: wso2is-analytics
Expand All @@ -39,3 +41,4 @@ servers:
ram: 2048
cpu: 1
provisioner_script: identity-server-analytics/provisioner/product_provisioner.sh
conf_dir: identity-server-analytics/confs
6 changes: 4 additions & 2 deletions identity-server-analytics/provisioner/product_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
WUM_HOME=/usr/local
WUM_PATH=PATH=$PATH:/usr/local/wum/bin
DEFAULT_MOUNT=/vagrant
CONFIGURATIONS=${DEFAULT_MOUNT}/identity-server-analytics/confs
CONFIGURATIONS=${WORKING_DIRECTORY}/identity-server-analytics/confs
NODE_IP=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

# operate in anti-fronted mode with no user interaction
Expand Down Expand Up @@ -77,6 +76,9 @@ echo "Successfully copied the files."
export JAVA_HOME
export WUM_PATH

echo "Removing configurations directories."
rm -rf ${CONFIGURATIONS}

# start the WSO2 product pack as a background service
echo "Starting ${WSO2_SERVER}-${WSO2_SERVER_VERSION}..."
sh ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/bin/wso2server.sh start
Expand Down
6 changes: 4 additions & 2 deletions identity-server/provisioner/product_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
WUM_HOME=/usr/local
WUM_PATH=PATH=$PATH:/usr/local/wum/bin
DEFAULT_MOUNT=/vagrant
CONFIGURATIONS=${DEFAULT_MOUNT}/identity-server/confs
CONFIGURATIONS=${WORKING_DIRECTORY}/identity-server/confs
NODE_IP=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

# operate in anti-fronted mode with no user interaction
Expand Down Expand Up @@ -79,6 +78,9 @@ echo "Successfully copied the files."
export JAVA_HOME
export WUM_PATH

echo "Removing configurations directories."
rm -rf ${CONFIGURATIONS}

# start the WSO2 product pack as a background service
echo "Starting ${WSO2_SERVER}-${WSO2_SERVER_VERSION}..."
sh ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/bin/wso2server.sh start
Expand Down
8 changes: 6 additions & 2 deletions mysql/provisioner/db_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

DB_USER=root
DB_PASSWORD=wso2carbon
WORKING_DIRECTORY=/home/vagrant

# run product db script
echo "Execute the database scripts..."
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source /vagrant/mysql/scripts/mysql.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source /vagrant/mysql/scripts/um_mysql.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/mysql.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/um_mysql.sql"
echo "Successfully executed the database scripts."

# grants root access to MySQL server from any host
Expand All @@ -34,3 +35,6 @@ echo "Grant access to the user..."
mysql -u${DB_USER} -p${DB_PASSWORD} -e "grant all privileges on *.* to 'root'@'%' with grant option;"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "flush privileges;"
echo "Successfully granted access to the user."

echo "Removing configurations directories."
rm -rf ${WORKING_DIRECTORY}/mysql

0 comments on commit ddbeeab

Please sign in to comment.