This document provides instructions on how to deploy the Deployment API application.
The Deployment API application is a Spring Boot application that allows users to deploy applications to WebSphere.
The application takes in a JSON request with the following parameters:
projectName
, repoUrl
, destinationFolder
, virtualHost
, username - [optional]
, password - [optional]
It is the user responsibility to ensure that the application is buildable and can be deployed successfully.
To avoid first time build issues:
- If Legacy App, Ensure that the first time the application is deployed, all required JARs are listed in the Eclipse classpath.
- If Maven App, Ensure that the first time the application is deployed, all required JARs are listed in the POM.xml file.
- Verify the required application JARs for your project are in the
web-app/WEB-INF/lib
directory of the instance of the hosted deployment api you are deploying to, or are in theWEB-INF/lib
directory of your project. - You only need to do this once for each project, or if the JARs are updated on the project.
- The application is built using Java 17 and Spring Boot.
- The application is built using Maven.
- The SVN legacy deployment application should have a .classpath file that lists all the required JARs for the application to successfully build.
- The Git deployment application should have a POM.xml file that lists all the required JARs for the application to successfully build.
- For Angular applications, if you only build the Git/SVN endpoint, it is assumed the application has been built and the content of the have been copied to the WebContent folder before being committed to the repository.
- There are separate endpoints specifically for Angular SVN or Angular Git Repos.
The current version of the Deployment API application was built with the following assumptions:
- This application is only for deploying applications to WebSphere.
- This application will be ONLY called by a Deployment Management UI
- The legacy structure of the SVN repository is static and will not change there is no POM.xml file.
- The Git repository structure is open to change with the POM.xml file or Eclipse classpath file.
Given more time, the following enhancements could be made:
- Git should have multiple endpoints for either an eclipse classpath or a POM.xml file.
- SVN should have multiple endpoints for either an eclipse classpath or a POM.xml file.
- Deployment of UI applications to saved repositories.
The document contains the following Information:
- Pre-requisites
- Steps
- Adjustments Made
- Happy Path Flow
- Source Controller
- RepoService
- WebSphere/Interface/WebSphere
- WebSphere/Implementation/WebSphereImpl
- GenerateWebBndXMI
- GenerateWebExtXMI
- Java 17 or higher with WAS 9 (configured for Java 8)
- Maven
- Git
- SVN
- SVN Client w/ Full Command Line- TortoiseSVN located at: C:\Program Files\TortoiseSVN\bin
- Git w/ a token for authentication.
- Creation of a C:\deployments\deploymentFiles directory (for the application to deploy to).
- Each Project (if being deployed via this tool for the first time should have all required JARs listed in the Eclipse classpath). a. This is to ensure that the application can be built and deployed successfully.
- Clone the repository to your local machine.
- Open the terminal and navigate to the project directory.
- Run the following command to build the project:
mvn clean install
- Run the following command to start the application:
mvn spring-boot:run
- The application will be accessible at a default port or via
http://localhost:8080
. - Request needs to be made like: This is the Git or SVN endpoints.
{
"projectName": "repoName",
"repoUrl": "SubDirectory to SVN or Git Host",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "intranet_host/extranet_host/etc"
}
OR like: This is the Angular Repo
{
"projectName": "This is the contextRoot from WebSphere",
"angularProjectName": "This is the technical project name; the base root name",
"angularVersion": "This is the version of Node you use to build the Angular Repo",
"angularRepoUrl": "Here is the Repo for Angular",
"serviceRepoUrl": "Here is the Repo for the Service",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "intranet_host/extranet_host/etc"
}
Ensure a local SVN client exists such as TortoiseSVN or SlikSVN.
- C:\Users<Workstation>\AppData\Roaming\Subversion\servers
- Ensure the following is added to the servers file
[global] http-auth-types = basic;digest;negotiate;ntlm ssl-trust-default-ca = yes
- Command Prompt should download an example directory from SVN.
- Source Controller - Intakes the JSON body and determines the source control type via the URL.
- RepoService - Determines the source control type and calls the appropriate service.
- RepoService - Download the Repo and Package the WebSphere files (passes on request info to WS Interface).
- RepoService - checkoutSvnRepo will use SVN to download the repo & package the WebSphere required files into the repo.
- RepoService - cloneGitRepo will use Git to download the repo & package the WebSphere required files into the repo.
- WebSphere - Interface to WebSphere to deploy the application.
- WebSphere - GenerateXMIFiles will generate the XMI binding files for WebSphere using the methods in Impl.
- WebSphere - GenerateXMLFiles will generate the XML binding files for WebSphere using the methods in Impl.
- GenerateWebBndXMI - This will use generated ibm-web-bnd.xmi file to deploy the application to WebSphere.
- GenerateWebExtXMI - This will use the generated ibm-web-ext.xmi file to deploy the application to WebSphere.
- GenerateWebBndXML - This will use the generated ibm-web-bnd.xml file to deploy the application to WebSphere.
- GenerateWebExtXML - This will use the generated ibm-web-ext.xml file to deploy the application to WebSphere.
- WebSphere - DeployApplication will Execute JAR Generation.
- WebSphere - This will execute the reading of the classpath files, and copy necessary JARs to WEB-INF/lib from eclipse classpath or POM.xml.
- RepoService - After all files are generated, the RepoService will drop the files at the specified destination & return the URL.
- Source Controller - The Source Controller will call the PackagingAndMoveFiles method to package the WAR and EAR files from the directory.
- Source Controller - The WAR file is packaged using the RepoService.packageWar method.
- RepoService - The WAR file is packaged using ANT packaging method.
- Source Controller - The EAR file is packaged using the RepoService.packageEar method.
- RepoService - The EAR file is packaged using ANT packaging method.
- Source Controller - The Source Controller endpoint instructions will move the files to the destination folder.
- RepoService - If the destination folder has a file already, the old file will have a timestamp appended to the end of the file name.
- Source Controller - The Source Controller will return a success message to user.
Ensure Git command client exists on the server.
- Source Controller - Intakes the JSON body and determines the source control type via the URL.
- RepoService - Determines the source control type and calls the appropriate service.
- RepoService - Download the Repo and Package the WebSphere files (passes on request info to WS Interface).
- RepoService - checkoutSvnRepo will use SVN to download the repo & package the WebSphere required files into the repo.
- RepoService - cloneGitRepo will use Git to download the repo & package the WebSphere required files into the repo.
- WebSphere - Interface to WebSphere to deploy the application.
- GenerateWebBndXMI - This will use generated ibm-web-bnd.xmi file to deploy the application to WebSphere.
- GenerateWebExtXMI - This will use the generated ibm-web-ext.xmi file to deploy the application to WebSphere.
- GenerateWebBndXML - This will use the generated ibm-web-bnd.xml file to deploy the application to WebSphere.
- GenerateWebExtXML - This will use the generated ibm-web-ext.xml file to deploy the application to WebSphere.
- WebSphere - DeployApplication will Execute JAR Generation.
- WebSphere - This will execute the reading of the classpath files, and copy necessary JARs to WEB-INF/lib from eclipse classpath or POM.xml.
- RepoService - After all files are generated, the RepoService will drop the files at the specified destination & return the URL.
- Source Controller - The Source Controller will call the PackagingAndMoveFiles method to package the WAR and EAR files from the directory.
- Source Controller - The WAR file is packaged using the RepoService.packageWar method.
- RepoService - The WAR file is packaged using ANT packaging method.
- Source Controller - The EAR file is packaged using the RepoService.packageEar method.
- RepoService - The EAR file is packaged using ANT packaging method.
- Source Controller - The Source Controller endpoint instructions will move the files to the destination folder.
- RepoService - If the destination folder has a file already, the old file will have a timestamp appended to the end of the file name.
- Source Controller - The Source Controller will return a success message to user.
No extra adjustments at this time.
- Source Controller - Intakes the JSON body and determines the source control type via the URL.
- RepoService - Determines the source control type and calls the appropriate service.
- RepoService - Download the Repo and Package the WebSphere files (passes on request info to WS Interface).
- RepoService - checkoutSvnRepo will use SVN to download the repo & package the WebSphere required files into the repo.
- RepoService - cloneGitRepo will use Git to download the repo & package the WebSphere required files into the repo.
- WebSphere - Interface to WebSphere to deploy the application.
- GenerateWebBndXMI - This will use generated ibm-web-bnd.xmi file to deploy the application to WebSphere.
- GenerateWebExtXMI - This will use the generated ibm-web-ext.xmi file to deploy the application to WebSphere.
- GenerateWebBndXML - This will use the generated ibm-web-bnd.xml file to deploy the application to WebSphere.
- GenerateWebExtXML - This will use the generated ibm-web-ext.xml file to deploy the application to WebSphere.
- WebSphere - DeployApplication will Execute JAR Generation.
- WebSphere - This will execute the reading of the classpath files, and copy necessary JARs to WEB-INF/lib from eclipse classpath or POM.xml.
- RepoService - All WebSphere files are generated.
- Angular - Angular code gets pulled from SVN or Git.
- Angular - Angular code compiled via NVM/NPM commands.
- Angular - Angular code in dist folder when compiled.
- Angular) - Angular code unpacks dist folder and puts it in the active service folder's WEB-INF/Web-Content Folder.
- RepoService - The RepoService will drop the files at the specified destination & return the URL.
- Source Controller - The Source Controller will call the PackagingAndMoveFiles method to package the WAR and EAR files from the directory.
- Source Controller - The WAR file is packaged using the RepoService.packageWar method.
- RepoService - The WAR file is packaged using ANT packaging method.
- Source Controller - The EAR file is packaged using the RepoService.packageEar method.
- RepoService - The EAR file is packaged using ANT packaging method.
- Source Controller - The Source Controller endpoint instructions will move the files to the destination folder.
- RepoService - If the destination folder has a file already, the old file will have a timestamp appended to the end of the file name.
- Source Controller - The Source Controller will return a success message to user.
{
"projectName": "servrepo",
"repoUrl": "repo/Service",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "default_host"
}
{
"projectName": "servrepo",
"repoUrl": "Service.git",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "default_host"
}
{
"projectName": "angrepo",
"angularProjectName": "ANG-REPO",
"angularVersion": "16.10.2",
"angularRepoUrl": "repo/branches/devbranch/Angular",
"serviceRepoUrl": "repo/Service",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "default_host"
}
{
"projectName": "angrepo",
"angularProjectName": "ANG-REPO",
"angularVersion": "16.10.2",
"angularRepoUrl": "Angular.git",
"serviceRepoUrl": "Service.git",
"destinationFolder": "C:/deployments/deploymentFiles",
"virtualHost": "default_host"
}