Hub Deployment Process Tooltwist 8.3 - tooltwist/documentation GitHub Wiki

ToolTwist 8.3 Standalone Controller Set up and Deployment Process

Set up :

  • Node.Js
  • Java
  • ImageMagic
  • Git Hub
  • Ruby
  • Grunt
  • Esprima

To check the pre-requisites run the command below in your terminal.

  • $ node --version
  • $ javac -version
  • $ convert -version
  • $ git --version
  • $ ruby --version

Installation

Standalone Controller Set-up

Setting up of ssh key to server.

  • $ cd ~/.ssh
  • $ vi id_rsa.pub
  • Then copy the content of id_rsa.pub
  • ssh key example : ssh-rsa AAAAB3NzaC1yc2EAAAADAQABccccBAQDcvNo1KOKid8keeUlXo0VketcDIHlwDXfqYJ416sLUNlbVmSY1stZI/PaT+2yL8ffEvtvExSzf0mKv3sNBCssL2rP1gcbFA2roXxoKeAmtYgQWj+bk2fk13Hbog1bnEf0R0jdctL5qqzpgaMbUPq4NGgDiPTC8aEkK8sd3KoLuwIM6t6w+jbAWKlNt7dR+1iRkw7ooSl/3JVwFPcDf9h2uxkfTWylLoKeSyDZIem0p4H1MX6fdp/W2o8gNIpemYCbwAF2Di6ChZ9If2QzxV3+8WNJufJbbaQRs8iMO9sg1eQl2wSAKZE/apaHHDyLFQWdZUMzCDWektb0VDeLYoWuN [email protected]
  • In your Server add your ssh key in authorized_keys file located in ~/.ssh folder.

In your Server add your ssh key in authorized_keys file located in ~/.ssh folder.

  • $ mkdir Development

And then create another folder inside Development folder.

  • $ cd Development
  • $ mkdir new_folder_name (ex: $ mkdir HubProject)

Then clone the hub project from the repository inside the HubProject folder.

  • $ cd HubProject
  • $ git clone [email protected]:twistresources/rpdata-hub.git
  • $ cd rpdata-hub
  • $ git checkout hub-development

Install Tooltwist-cli

  • $ sudo npm install -g tooltwist

Running tooltwist init Designer will create a tooltwist java script (tooltwist.js).

  • $ cd ~/Development/{Project Folder}/{Project from git}
  • $ tooltwist init designer

Result :

Specification file 'tooltwist.js' has been created with a default configuration that will run the ToolTwist Designer on the demo webdesign project 'ttdemo'. Modify this file to suit your needs, then run:

Modify the tooltwist.js

  • $ vi tooltwist.js
  • Removed the content of tooltwist.js and copy and paste the script below.

exports.config = {

/*
 *      Mode should be one of the following:
 *        designer - Run the ToolTwist designer in standalone mode.
 *
 *        deploy - Generate, validate, and install the project to a
 *                 remote location.
 *
 *        controller - Similar to deploy mode, but is compatible
 *                 with the v8.2 Controller (i.e. it uses config
 *                 files beneath /ContollerV8).
 */
"mode" : "deploy",

"designer" : {

	/*
	 *	The port where the Designer will run. (default is 5000)
	 */
	//"port": 8888,

	/*
	 *	This section defines the web design project we are working with. Access to
	 *	the Git repo should be available without login credentials (ie. via SSH).
	 *
	 *	Not required for controller mode.
	 */
	"name" : "myrp",
	"repo" : "[email protected]:twistresources/rpdata-myrp-webdesign.git",
	"branch" : "hub-development_TT8.3",

	//
	// This is URL of the repository used to find JAR files and other
	// dependencies required by your webdesign project. The dependencies
	// themselves are defined in project.json in the webdesign project.
	//
	"repository_url" : "http://repo.tooltwist.com/artifactory/rpdata-all-in-one",
		
	// The default is anonymous access.
	// Comment this out if you switch 
	"repository_user": "",
	"repository_password": ""

	// Example using credentials from Artifactory.
	// "repository_user": "fred.smith",
	// "repository_password": "{DESede}xyxyxyxyxyxyxyxyxyxyxy=="

	// Example using ARTIFACTORY_USER and ARTIFACTORY_PASSWORD properties,
	// which can be defined system-wide in ~/.gradle/gradle.properties.
	// "repository_user": "property.ARTIFACTORY_USER",
	// "repository_password": "property.ARTIFACTORY_PASSWORD"
},


"deploy" : {
	servers: [
                    {
                            id: "myrp-dev",
                            description: "MyRP Dev Server",
                            host: "10.72.3.96",
                            disable: false,
                            isProductionServer: true,
                            serverHome: "/home/myrp/server",
                            webappName: "ttsvr",
                            installMethod: "fip",
                            imagemagickHome: "/usr/local",
                            fipPort: 39393,
                            sshUser: "myrp",
                            sshPort: 22,

                            // Hopefully obsolete
                            installCmd: "",
                            installTomcat: false,
                            username: "",
                            password: "",
                            webappsDir: "/home/myrp/server/tomcat/webapps",
                            tomcatHome: "/home/myrp/server/tomcat",
                            httpPort: 8080,
                            httpsPort: 8443,
                            serverPort: 8082,
                            ajpPort: 8083,
                            webcontentInJars: false
                    }
            ]

}

};

Create tooltwist templates.

  • $ tooltwist example-templates
  • This will create a deployment template.

Deployment in Dev

The fip in dev server should be running while doing the deployment.

  • In dev server :
    • $ rm ~/server/.fip-destination
    • $ cp /dev/null ~/logs/tooltwist.log
    • $ cp /dev/null ~/logs/fipserver.log
    • $ cd ~/fip
    • $ nohup ./fipserver -v 39393 > ~/logs/fipserver.log &
  • To view the logs of fip, $ tail -f ~/logs/fipserver.log

Go back to your local machine and

  • $ cd ~/Development/HubProject/rpdata-hub
  • $ tooltwist -i deploy

This command will do the task below.

  • Checking of prerequisites.
  • Creation of directories.
  • Cloning of web design from git.
  • Downloading of Dependencies.
  • Creation of build and config files.
  • Auto generation of navpoints. (Error in Hub)

Expected error in Hub

Call server to generate navpoints. uri=http://localhost:5000/ttsvr/generator?project=rpdata-myrp-webdesign&webapp=ttsvr&base=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/do_generate&config=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/do_generate/filter-1.xml&deploy=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/PHASE1/ttsvr&buildId=20140720-1759 http://localhost:5000/ttsvr/generator?project=rpdata-myrp-webdesign&webapp=ttsvr&base=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/do_generate&config=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/do_generate/filter-1.xml&deploy=/Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/PHASE1/ttsvr&buildId=20140720-1759 +----------------------------------------------------------------------------------------+ | START: filter-1.xml | logs in /Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/do_generate/logs/20140720-1759-thread-1/ `-----------------------------------------------------------------------------------------

** Thread 1: *

  • ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
  • Error contacting server: [object Object]

** Force the deployment by running the command below.**

  • $ cd /Users/cgcanceran/Development/hub-development/rpdata-hub/.tooltwist/PHASE2
  • ./DOIT

This command will force to complete the PHASE2 process including the files transfer using fip.

** On Dev Server.**

  • After the completion of the file transfer, log in to your Dev Sever and do the steps below.
    • $ cd ~/server/webdesign-projects
    • $ mv rpdata-myrp-webdesign myrp
    • $ cd ~/server/extension-projects
    • $ mv rpdata-hub myrp_t
    • then update all configuration file if there is an update.
    • $ . ~/bin/setenv.sh
    • $ start (running of the application)
    • $ log (to view catalina logs)

The end.