A container agnostic deployment management tool for application servers
- Containers Supported
- Getting Started
- Available Gradle tasks
- Usage
- Uploading artifact to Nexus
- Continuous Integration
- WebSphere Application Server
- WildFly
- Windows Services
Maven:
<dependency>
<groupId>com.exictos.devops</groupId>
<artifactId>libero</artifactId>
<version>1.6.0</version>
</dependency>
Gradle:
compile group: 'com.exictos.devops', name: 'libero', version: '1.6.0'
- Clone the project
git clone [email protected]:devops/libero.git
- Run the following command on the root of the project:
gradlew build
gradlew test
This is a list of useful Gradle tasks:
Task | Description |
---|---|
gradlew shadowJar |
Creates an UberJar of the project |
gradlew upload |
Uploads the current version to a hosted Nexus |
gradlew createExe |
Creates a .exe wrapper around the UberJar |
gradlew groovydoc |
Generates the API documentation |
C:\> java -jar libero.jar -help
usage: libero -container <CONTAINER> [-host] [...]
Install an application in either WildFly, WebSphere or as a Windows
service
-appLocation <APPLOCATION> The path to the application package
-appName <APPNAME> The application name
-appVersion <APPVERSION> The application version
-argument <ARGUMENT> The argument to append to the
install directory. (usually the
entry point file)
-bin <BIN> The path to the service executable
(eg. node.exe)
-container <CONTAINER> [REQUIRED] The container you wish
to deploy to.
WildFly - 'wildfly'
WebSphere - 'websphere'
Windows Service - 'ws'
-help Show help
-host <HOST> Hostname or IP
-install Installs an application with
rollback
-installDir <INSTALLDIR> The path to the directory where
you'd like to install the service
-nssm <NSSM> The path to the NSSM executable
-password <PASSWORD> Application server admin password
-port <PORT> Management or SOAP port
-start Start application after installing
-startMostRecentApps Start all most recent applications
-stopAllApps Stops all applications installed
-uninstallAppOldInstances <APPNAME> Uninstalls old instances from an
application
-uninstallOldInstances Uninstalls all old instances
-username <USERNAME> Application server admin username
-wsadmin <WSADMIN> The path to WebSphere wsadmin
script
Please report issues at https://gitlab.dcs.exictos.com/devops/libero
C:\> java -jar libero.jar -container wildfly -host ***REMOVED*** -port 9997 -username admin -password ***REMOVED*** -appName BackOfficeWS -appLocation C:/BackOfficeWSEAR.ear -appVersion 1.2.3
Container wildfly = new WildFly("***REMOVED***", 49990, ***REMOVED***, ***REMOVED***.toCharArray())
wildfly.connect()
wildfly.installAppWithRollBack("C:/packages/irc/IRC_WS_BBEAR.ear","IRC_WS_BB")
Container was = new WebSphere("***REMOVED***", 8881, ***REMOVED***, ***REMOVED***.toCharArray(), "C:/IBM/WebSphere/AppServer/bin/wsadmin.bat")
was.installAppWithRollBack("C:/packages/irc/IRC_WS_BBEAR.ear","IRC_WS_BB")
Container appserver = new WildFly/WebSphere(...)
// Explicitly connect if deploying to WildFly
appserver.connect()
String deployment = appserver.profile.listInstances("IRC_WS_BB").first().getName()
appserver.startApp(deployment)
Container appserver = new WildFly/WebSphere(...)
appserver.connect()
println "Installed applications: "
appserver.profile.listInstalledApplications().each{ instance ->
println "\t - instance"
}
The output would be something like:
Installed applications:
- IRC_WS_BB
- Server
- ReportingServices
Container appserver = new WildFly/WebSphere(...)
// Explicitly connect if deploying to WildFly
appserver.connect()
appserver.startMostRecentApps()
ServiceManager ws = new ServiceManager()
Service service = new Service()
service.set_package(new File("C:\\package\\pfs_hardware.zip"))
service.setBin(new File("C:\\Users\\jcoelho\\AppData\\Roaming\\nvm\\v6.11.2\\node.exe"))
service.setInstallDirectory(new File("C:\\NodeJS"))
service.setName("Exictos - PFS Hardware")
service.setArguments(["main.js"])
ws.installServiceWithRollback(service)
If you need Libero to log to a specific file do the following:
File logFile = new File("C:/Exictos/logs/deployment.log")
Container was = new WebSphere(...)
was.setLogFile(logFile)
was.installAppWithRollBack(...)
Check out the wiki
- Make sure the project ìnformation specified in
build.gradle
is correct
project.version = "1.6.0"
project.name = "libero"
project.group = "com.exictos.devops"
- Set the following variables in the gradle.properties file:
nexusUrl=https://nexus.dcs.exictos.com
nexusUsername=<ldap_username>
nexusPassword=<ldap_password>
- Run the following command:
gradlew upload
There is a pipeline set up, in Jenkins, to read and execute the Jenkinsfile
from this repository.