In this section you will learn how to start virtual machines based on CentOS in Virtual Box and install the CoreMedia Blueprint services and applications onto these machines using the RPM artifacts being built by the modules below packages.
Starting the Box
During the build of the workspace, you have prepared an RPM
repository below $CM8_BLUEPRINT_HOME/boxes/target/shared/rpm-repo
. All
files below the shared
folder are accessible from the box.
Start the box with the following command:
$ cd $CM_BLUEPRINT_HOME $ vagrant up
If you do this the first time, you will notice a lengthy download of a large file. This is the download of the base box, a bare CentOS 6 system with only Java being installed. This download will only be done once as Vagrant is caching the base boxes.
After the box has been downloaded Vagrant imports the box, configures it, for example sets the number of CPUs or the RAM and the network configuration. The latter step requires you to add a network adapter to the host system, so you have to confirm some dialogues if you are using Windows.
After configuring the hardware, Vagrant boots up the box. When the system is running the vagrant-vbguest and the vagrant-omnibus Vagrant plugins will now outfit the box with the matching Virtual Box Guest Additions and the configured version of Chef. These steps may take a couple of minutes but guarantee you a proper host to guest communication and eases the maintenance of the base boxes.
Now the box is ready for provisioning and Vagrant will start Chef to install and configure CoreMedia services. Some minutes later your blueprint box will be online with all services running, all content imported and published and ready to develop against.
For an overview of the installed applications and services and their links, see the README.md
markdown file,
in the root directory of the workspace. To see an overview of all ports see Section 9.1, “Port Reference”.
If you want some insight on the state of your system, you can open up the PSDash web interface at http://localhost:8999 to monitor available log files. This interface is only available on the box started with Vagrant and is intended for development support only. To log into the box simply execute
$ cd $CM_BLUEPRINT_HOME $ vagrant shh
If you don't have ssh
on your PATH, you can call
$ cd $CM_BLUEPRINT_HOME $ vagrant ssh-config
and use the configuration with the ssh tool of your choice.
Depending on the performance of the host machine, the process of starting up and provisioning the management box can take some time. To avoid this overhead, you can pause the system until you need it again. From the moment the system is up and running, its not Vagrant running the system anymore, its Virtual Box and you may use all features of Virtual Box to control your box, for instance export it, pause it or resume it. Vagrant is nothing more than a configuration and bootstrapping tool.
To connect to the WebDAV web application as a network drive a necessary certificate will be generated automatically during the provisioning. How to install such a certificate is described in Section 8.6, “WebDAV Support”.
By default, the delivery Blueprint CAE will be connected with the Master Live Server not the Replication Live Server.
Update your Box
If you have developed a feature in module X and you want to deploy and test it in your isolated box environment, all you have to do is the following:
Build the changed module and all affected artifacts, for the
contentserver-blueprint-component
, for example, execute:$ cd $CM_BLUEPRINT_HOME/modules $ mvn -pl ":contentserver-blueprint-component" clean install -amd
Update the RPMs in the boxes module:
$ cd $CM_BLUEPRINT_HOME/boxes $ mvn antrun:run
Reprovision the box containing the change, for example
vagrant provision
, to update the RPMs. You can also use the provision call without new RPMs, just to apply any configuration changes. Only the services for which Chef detects changes, will be restarted.$ cd $CM_BLUEPRINT_HOME $ vagrant provision
Suspend your Box
When you want to suspend you work for some reasons for example your daily job is done, you can
simply suspend the box calling the suspend command on a box for instance vagrant
suspend
.
$ cd $CM_BLUEPRINT_HOME $ vagrant suspend
Resume your Box
To resume your work, simply call the resume command on a box for example vagrant
resume
.
$ cd $CM_BLUEPRINT_HOME $ vagrant resume
Destroy your Box
When you have finished your work or you want to start on from scratch, simply call the destroy
command on a box, for example vagrant destroy
.
$ cd $CM_BLUEPRINT_HOME $ vagrant destroy