continuous integration with tibco activematrix ......continuous integration with tibco activematrix...

13
Continuous Integration with TIBCO ActiveMatrix BusinessWorks6 using Maven, Jenkins and JFrog Artifactory This document provides step-by-step instructions to setup CI/CD for TIBCO BusinessWorks 6.3.2 using Maven, Jenkins and JFrog Artifactory. This document can be used as a reference. Document Version: 0.1 Document Date: 07/30/2016 Revision History Version Date Author Comments 0.1 07/30/2016 TIBCO Initial Version

Upload: others

Post on 15-Mar-2020

35 views

Category:

Documents


2 download

TRANSCRIPT

Continuous Integration with TIBCO ActiveMatrix BusinessWorks6 using Maven, Jenkins and JFrog

Artifactory

This document provides step-by-step instructions to setup CI/CD for TIBCO

BusinessWorks 6.3.2 using Maven, Jenkins and JFrog Artifactory. This document can be

used as a reference.

Document Version: 0.1

Document Date: 07/30/2016

Revision History

Version Date Author Comments

0.1 07/30/2016 TIBCO Initial Version

Table of Contents

1 Pre-requisite software ..................................................................... 3

2 Setup and Installation...................................................................... 4

Maven 3.3.x ........................................................................................... 4 JFrog Artifactory ..................................................................................... 4 Jenkins .................................................................................................. 4 TIBCO ActiveMatrix BusinessWorks 6.3.2..................................................... 4 TIBCO Enterprise Administrator 2.2.0 ......................................................... 4 BW 6 Maven Plugin 1.1.0 .......................................................................... 4

3 Artifactory Maven plugin configuration in Jenkins ......................... 6

4 Jenkins tool configurations and global settings ............................. 7

5 Configure Maven to resolve artifacts through Artifactory.............. 8

6 Deploy BW 6 Maven plugins to Artifactory...................................... 9

7 Generate Parent POM for BW6 project ..........................................10

8 Create Jenkins build job to build/deploy BW6 project .................12

1 Pre-requisite software

The below software and TIBCO products need to be installed.

Apache Maven 3.3.9 (http://maven.apache.org/)

JFrog Artifactory OSS (https://www.jfrog.com/open-source/)

Jenkins/Hudson (https://jenkins.io/)

TIBCO Activematrix BusinessWorks 6.3.2

TIBCO Enterprise Administrator 2.2.x

Maven plugin 1.1.0 for BW 6.3.x (https://github.com/TIBCOSoftware/bw6-plugin-

maven/)

2 Setup and Installation

Maven 3.3.x

1. Download Maven 3.3.9 from http://maven.apache.org and unzip the archive in a

directory e.g. C:\apache\apache-maven-3.3.9

2. Set M2_HOME = C:\apache\apache-maven-3.3.9

3. Set PATH to %M2_HOME%\bin

JFrog Artifactory

1. Download JFrog Artifactory OSS 4.10 from https://www.jfrog.com/open-source/

and unzip the archive in a directory e.g. C:\artifactory-oss-4.10.0

2. Install Artifactory as a Windows service or run artifactory.bat (on Windows) or

artifactory.sh (on Unix)

3. Artifactory can be accessed using the following URL:

http://localhost:8081/artifactory

Jenkins

1. Download Jenkins 2.7.1 from https://jenkins.io and unzip the archive in a

directory e.g. C:\jenkins-2.7.1

2. Install Jenkins as a Windows service or start Jenkins from terminal using

commands: java –jar C:\jenkins-2.7.1\jenkins.war

3. Jenkins can be accessed using the following URL: http://localhost:8080

TIBCO ActiveMatrix BusinessWorks 6.3.2

1. Download and install BW 6.3.x in new or existing TIBCO_HOME e.g. C:\tibco_bw6

2. Start bwagent in enterprise mode

TIBCO Enterprise Administrator 2.2.0

1. Download and install TEA 2.2.x in new or existing TIBCO_HOME e.g.

C:\tibco_bw6

2. Start TEA server.

3. TEA server can be accessed using the following URL: http://localhost:8777

BW 6 Maven Plugin 1.1.0

1. Download the BW 6 Maven plugin 1.1.0 from

https://github.com/TIBCOSoftware/bw6-plugin-maven/

2. Unzip the archive in a directory.

3. Open the terminal and run install.bat (on Windows) or install.sh (on Unix)

4. The installer will prompt for TIBCO BW6 Home location.

5. The maven plugin will be installed in the directory TIBCO_HOME\bw\6.3\

maven\plugins\bw6-maven-plugin

6. The BW 6 maven plugins will also be installed in the Maven local repository along

with their dependencies

3 Artifactory Maven plugin configuration in

Jenkins

1. Login to Jenkins, go to Manage Jenkins -> Manage Plugins and install the

Artifactory plugin

2. Go to Manage Jenkins -> Configure System to configure the Artifactory Plugin

details

3. Configure the artifactory server URL and credentials that will be used for artifact

resolution

4. Apply and Save the settings.

4 Jenkins tool configurations and global settings

1. Login to Jenkins, go to Manage Jenkins -> Global Tool Configuration

2. Setup JAVA_HOME in JDK

3. Setup GIT exe in GIT, if applicable

4. Setup MAVEN_HOME in Maven. Uncheck the Install automatically checkbox

5. Apply and Save the settings

6. Go to Manage Jenkins -> Configure System

7. Provide appropriate values for Maven Project Configuration settings

8. Apply and Save the settings

5 Configure Maven to resolve artifacts through

Artifactory

1. Artifactory automatically generates a settings.xml which can be saved using

Maven home directory e.g. C:\Users\Administrator\.jenkins\settings.xml

2. Login in Artifactory. Default credentials are admin/password.

3. In the Artifact Repository Browser of the Artifacts module, select Set Me Up

4. In the Set Me Up dialog, set Maven in the Tool field and click "Generate Maven

Settings".

5. Clicking on “Download Snippet” will generate a settings.xml which can be saved

in Maven Home directory e.g. C:\Users\Administrator\.jenkins

6 Deploy BW 6 Maven plugins to Artifactory

1. In order for the BW 6 maven plugin artifacts to be resolved from Artifactory, they

need to be deployed to Artifactory.

2. Create a deploy.bat script to deploy the BW 6 maven plugins to artifactory in the

directory where BW 6 maven plugin was unzipped.

echo Depl oyi ng Maven Pl ugi n to Arti factory Reposi tory

st art cmd. exe /C mvn depl oy:depl oy-file -Df i le=bw6-maven-pl ugi n-1.1.0.jar -DpomFi l e=pom. xml -

Dr eposi toryId=central -Durl =http: //local host:8081/artifactory/pl ugi ns-rel ease-local

st art cmd. exe /C mvn depl oy:depl oy-file -Df i le=com. tibco.bw. pal et te.shared_6.1.100.003.jar -

Dgr oupId=com.tibco.pl ugi ns -DartifactId=com. tibco.bw. pal et te.shared -Dversion=6.1.100 -

Dpackagi ng=j ar -Dr eposi toryId=central -Durl =ht tp://local host:8081/artifactory/pl ugi ns-rel ease-local

7 Generate Parent POM for BW6 project

1. Open TIBCO Business Studio

2. Right-click on the BW 6 application project and select “Generate POM for

Application”

3. On the POM Generation UI, enter the parent POM details and select the “Deploy

EAR to BW Administrator” checkbox

4. Select Next

5. On the next UI screen, enter deployment details i.e. BW Agent Host, Port,

Domain, AppSpace, AppNode, AppNode HTTP Port, AppNode OSGI Port, Profile

etc.

6. Select Finish

7. The new Maven project will be generated with a Parent POM and the existing BW6

projects will also be converted to maven projects.

8 Create Jenkins build job to build/deploy BW6

project

1. Login to Jenkins, go to New Item

2. Enter an item name, select “Maven Project” and “OK”

3. Configure Source Code Management sec tion as per your environment.

4. Configure Build Triggers section as per needs.

5. Configure Build Environment section to resolve artifactory from Artifactory

a. Provide the Artifactory server URL from dropdown list and hit Refresh

Repositories

b. Select the Resolution releases and snapshots repository from dropdown

list

6. Configure Build section and provide maven root POM and goals along with

options, if required.

7. Add Post Steps and Post-Build Actions, if required.

8. Hit Apply and Save.

9. Once saved, click on the Build Now option to build and deploy the EAR.

10. On successful Build, login into TEA and view deployed application.