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 #7 from VimukthiPerera/master
Browse files Browse the repository at this point in the history
Moving configurations from boxes to machines
  • Loading branch information
chamithkumarage authored Feb 7, 2018
2 parents ad1f6aa + 0a9deb0 commit 0b2895b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
12 changes: 8 additions & 4 deletions boxes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ since, Vagrant uses Oracle VM VirtualBox as the default provider.

![Vagrant box build process](procedure.png)

##### 1. Checkout this repository into your local machine using the following Git command.
1. Checkout this repository into your local machine using the following Git command.
```
git clone https://github.com/wso2/vagrant-is.git
```
2. Download
[WSO2 Identity Server 5.4.0](https://wso2.com/identity-and-access-management#download), [JDK 8u144-linux-x64.tar](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and [MySQL Connector/J](https://dev.mysql.com/downloads/connector/j/). Copy them to the following path.

##### 2. Move to `boxes` folder.
~/vagrantboxes/files/

3. Move to `boxes` folder.

cd boxes

##### 3. Execute the build.sh shell script.
4. Execute the build.sh shell script.

./build.sh

##### 4. Add created box files to local Vagrant box cache.
5. Add created box files to local Vagrant box cache.

The created box files can be found in the output directory. In order to add a created box to the local Vagrant box cache use the `vagrant box add` command.

Expand Down
9 changes: 4 additions & 5 deletions boxes/identity-server-analytics/provisioner/provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ WSO2_SERVER=wso2is-analytics
WSO2_SERVER_VERSION=5.4.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz

DEFAULT_MOUNT=/vagrant
SOFTWARE_DISTRIBUTIONS=${DEFAULT_MOUNT}/files
WORKING_DIRECTORY=/home/vagrant
Expand Down Expand Up @@ -59,12 +58,12 @@ if test -d ${JAVA_HOME}; then
fi
echo "Successfully set up Java"

# unpack the WSO2 product pack to the working directory
echo "Setting up the ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server..."
# moving the WSO2 product pack to the working directory
echo "Moving the ${WSO2_SERVER_PACK} to the directory: ${WORKING_DIRECTORY}..."
if test ! -d ${WSO2_SERVER}-${WSO2_SERVER_VERSION}; then
unzip -q ${DEFAULT_MOUNT}/files/${WSO2_SERVER_PACK} -d ${WORKING_DIRECTORY}
mv ${DEFAULT_MOUNT}/files/${WSO2_SERVER_PACK} ${WORKING_DIRECTORY}
echo "Successfully moved ${WSO2_SERVER_PACK} to ${WORKING_DIRECTORY}"
fi
echo "Successfully set up ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server"

# set ownership of the working directory to the default ssh user and group
chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${WORKING_DIRECTORY}
Expand Down
9 changes: 4 additions & 5 deletions boxes/identity-server/provisioner/provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ WSO2_SERVER=wso2is
WSO2_SERVER_VERSION=5.4.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz

DEFAULT_MOUNT=/vagrant
SOFTWARE_DISTRIBUTIONS=${DEFAULT_MOUNT}/files
CONFIGURATIONS=${DEFAULT_MOUNT}/identity-server/confs
Expand Down Expand Up @@ -60,12 +59,12 @@ if test -d ${JAVA_HOME}; then
fi
echo "Successfully set up Java"

# unpack the WSO2 product pack to the working directory
echo "Setting up the ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server..."
# moving the WSO2 product pack to the working directory
echo "Moving the ${WSO2_SERVER_PACK} to the directory: ${WORKING_DIRECTORY}..."
if test ! -d ${WSO2_SERVER}-${WSO2_SERVER_VERSION}; then
unzip -q ${DEFAULT_MOUNT}/files/${WSO2_SERVER_PACK} -d ${WORKING_DIRECTORY}
mv ${DEFAULT_MOUNT}/files/${WSO2_SERVER_PACK} ${WORKING_DIRECTORY}
echo "Successfully moved ${WSO2_SERVER_PACK} to ${WORKING_DIRECTORY}"
fi
echo "Successfully set up ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server"

# set ownership of the working directory to the default ssh user and group
chown -R ${DEFAULT_USER}:${DEFAULT_USER} ${WORKING_DIRECTORY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,25 @@
# set variables
WSO2_SERVER=wso2is-analytics
WSO2_SERVER_VERSION=5.4.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
MYSQL_CONNECTOR=mysql-connector-java-5.1.*-bin.jar
WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
DEFAULT_MOUNT=/vagrant
CONFIGURATIONS=${DEFAULT_MOUNT}/identity-server-analytics/confs
NODE_IP=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

#setting up the server
if test ! -d ${WSO2_SERVER}-${WSO2_SERVER_VERSION}; then
unzip -q ${WORKING_DIRECTORY}/${WSO2_SERVER_PACK} -d ${WORKING_DIRECTORY}
echo "Successfully set up ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server"
fi

#moving MySQL driver
echo "Copying the MySQL driver to the server pack..."
cp ${WORKING_DIRECTORY}/${MYSQL_CONNECTOR} ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/lib/${MYSQL_CONNECTOR}
echo "Successfully copied the MySQL driver to the server pack."

# copy files with configuration changes
echo "Copying the files with configuration changes to the server pack..."
cp -Tr ${CONFIGURATIONS}/repository/conf/ ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/conf/
Expand Down
13 changes: 13 additions & 0 deletions machines/identity-server/provisioner/product_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,25 @@
# set variables
WSO2_SERVER=wso2is
WSO2_SERVER_VERSION=5.4.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
MYSQL_CONNECTOR=mysql-connector-java-5.1.*-bin.jar
WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
DEFAULT_MOUNT=/vagrant
CONFIGURATIONS=${DEFAULT_MOUNT}/identity-server/confs
NODE_IP=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')

#setting up the server
if test ! -d ${WSO2_SERVER}-${WSO2_SERVER_VERSION}; then
unzip -q ${WORKING_DIRECTORY}/${WSO2_SERVER_PACK} -d ${WORKING_DIRECTORY}
echo "Successfully set up ${WSO2_SERVER}-${WSO2_SERVER_VERSION} server"
fi

#moving MySQL driver
echo "Copying the MySQL driver to the server pack..."
cp ${WORKING_DIRECTORY}/${MYSQL_CONNECTOR} ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/lib/${MYSQL_CONNECTOR}
echo "Successfully copied the MySQL driver to the server pack."

# copy files with configuration changes
echo "Copying the files with configuration changes to the server pack..."
cp -Tr ${CONFIGURATIONS}/repository/conf/ ${WORKING_DIRECTORY}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/conf/
Expand Down

0 comments on commit 0b2895b

Please sign in to comment.