0.9.7 • Published 2 years ago

heringsfish-cli v0.9.7

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Logo

Heringsfish Command Line Interface (cli)

Command Line Interface to manages the Glassfish / Payara Application Server and the maven deployment on local machine

This is the last version of the version 0.x.x

Table of Content

Overview

The CLI allows you to a GlassFish or Payara Application Server easy to use and a encapsulated development environment for your JEE set 7 project.

Requirement

The following programs or modules are necessary:

  • Node JS: This cli is tested with the version 4.x and 6.x
  • Set the environment variable JAVA_HOME must be set.
  • Application Server Glassfish 4.1 or Payara 4.1: Just install the server somewhere on your computer or in the project.
  • Maven: The command mvn should in your PATH or setup in the configuration
  • An Java IDE :-)

Installation

Global install:

$ npm install -g heringsfish-cli

Github

$ cd /path/to/your/projects
$ git clone https://github.com/blueskyfish/heringsfish-cli.git
$ cd heringsfish-cli
$ npm install
$ npm test
$ npm link

Note: the command npm link creates an short link to the program. Now your are able to type in your console window hf .... May you need to call sudo npm link.

Find Help

Every action has a help or explanation page.

The command hf help [action] shows the help or explanation page. The help command shows all possible actions, when omitted the action parameter.

$ hf help
$ hf help init
$ hf help build

Quick Startup

( 1) $ cd /your/project
( 2) $ hf init
( 3) $ hf create
( 4) $ hf start
( 5) $ hf jdbc create --name testDB
( 6) $ hf deploy
( 7) $ open "http://localhost:30048/
( 8) $ open "http://localhost:30080/your-project
( 9) $ hf undeploy
(10) $ hf stop
(11) $ hf remove
  1. Change into your project
  2. Initialize the configuration for your project.
  3. Set create the domain
  4. Start the application server
  5. Create a JDB connection pool and JDBC resource
  6. Start the deployment
  7. Open the Admin Console of the application server
  8. Open your deployed web/rest (etc) application
  9. Undeploy the deployed application
  10. Stop the application server
  11. Remove and delete the domain.

Configure

The configure settings are in the file server-config.json. This file is in the project root directory and has format JSON.

  • edit the file server-config.json directly. example: $ nano server-config.json

Table of Configurable Settings

SettingsTypeDescription
nameStringThe application name
versionStringA version
server.homeStringThe path to the Application Server
maven.homeStringThe path to the Maven installation
maven.settingStringThe Maven settings.xml file
maven.projectStringThe om.xmlof the Project.
domain.nameStringThe domain name in the Application Server.
domain.homeStringThe path to the domain directory.
domain.deployMapA map with the deployment files.
domain.ports.baseNumberThe base port of the application (Admin Console Port is + 48, The application is on + 80).
domain.jdbcMapA map with the jdbc names and their settings.
command.timeoutNumberThe timeout in milliseconds. If the value is 0, then it is running infinity.
command.asadminObjectThe asAdmin command.
envObjectA key value map for the environment variables that is setting for the Application Server.

Example of Configure

{
    "name": "test-project",
    "version": "0.1.0-SNAPSHOT",
    "server": {
        "home": "{user.home}/bin/payara-4.1.1.154"
    },
    "maven": {
        "home": "{user.home}/bin/maven-3.3.4",
        "setting": "{project.home}/setting.xml",
        "project": "{project.home}/projects/pom.xml"
    },
    "domain": {
        "name": "test-project",
        "home": "{project.home}/domains",
        "deploy": {
            "rest-provider": "{project.home}/projects/rest-provider/target/rest-provider-0.1.0-SNAPSHOT.war",
            "business-beans": "{project.home}/projects/business-beans/target/business-beans-0.1.0-SNAPSHOT.jar"
        },
        "ports": {
            "base": 50000
        },
        "jdbc": {
            "testDB": {
                "dataSourceClassName": "com.mysql.jdbc.jdbc2.optional.MysqlDataSource",
                "restype": "javax.sql.DataSource",
                "properties": {
                    "user": "user",
                    "password": "password",
                    "url": "jdbc:mysql://localhost:3306/test"
                },
                "description": "This is the Test Database"
            }
        }
    },
    "command": {
        "timeout": 120000,
        "asadmin": {
            "win32": "{server.home}/bin/asadmin.bat",
            "unix": "{server.home}/bin/asadmin"
        }
    },
    "env": {
        "project.home": "{project.home}",
        "user.home": "{user.home}",
        "project.name": "{project.name}",
        "project.version": "{project.version}"
    }
}

List of Action

ActionOptional additional ArgumentsDescription
init-Create the config settings in the current project folder.
create-Creates the domain on the application server.
start-Starts the application server with the domain.
restartStops and starts the application server with the domain.
 -k or --killSpecifies whether the domain is killed by using functionality of the operating system to terminate the domain process.
deployBuild the application with maven and deploy on the application server..
 applicationthe name of the deploying application. If no application is specified, all Applications are deployed.
 --nobuildDisable the maven build process before deploying.
 --skipSkip to execute the test cases.
 -c or --cleanAdd the clean goal to the maven build process.
 -p profilesAdd the maven profile(s). To separated more profiles with ,.
 --profile=profilesAdd the maven profile(s). To separated more profiles with ,.
buildbuild the application with maven
 --skipSkip to execute the test cases.
 -c or --cleanAdd the clean goal to the maven build process.
 -p profilesAdd the maven profile(s)
 --profile=profilesAdd the maven profile(s)
testExecutes the maven test goal.
 -c or --cleanAdd the clean goal to the maven build process.
 -p profilesAdd the maven profile(s)
 --profile=profilesAdd the maven profile(s)
cleanExecute maven for clean the target directories.
listDisplay either the domains of the application server or the list of deployed application on the server.
 --appDisplay the deployed application on the application server.
 -d or --domainDisplay the domains of the application server.
undeployUndeploy and remove the application from the application server.
 applicationthe name of the deploying application. If no application is specified, all Applications are undeployed.
redeployUnfortunately it is not implemented yet. Instead use the action stop and then start.
stopStops the application server with the domain.
 -k or --killSpecifies whether the domain is killed by using functionality of the operating system to terminate the domain process.
remove-Remove and delete the domain on the application server.
jdbclistShow all JDBC connection pools and JDBC resources
 create -n jdbcNameCreate the JDBC connection pool and the JDBC resource from the given jdbc name.
 delete -n jdbcNameDelete the JDBC connection pool and the JDBC resource from the given jdbc name.
 ping -n jdbcNamePing and validate the JDB connection pool and the JDBC resource from given jdbc name.

JDBC Configuration

Documentation on Oracle

Replaced Variables

Certain variables can be replaced. The Application Server can be included in the project. By means of the variable project.home the directory of the project can be used.

For Example:

{
  "server": {
    "name": "${project.home}/tools/payara-4.1.1.154"
  }
}
NameValue or description
project.homeThe directory of the project
user.homeThe user home directory
domain.nameThe name of the domain
domain.homeThe domain home directory
versionThe project version
project.versionThe project version
nameThe project name
project.nameThe project name

Environment Variables

It is possible to define environment variables in the section env, which are also transferred when the application server starts.

See example above.

Road Map

  • Extends and defines project plugins. Every project should have own plugins.

History

VersionDateDescription
0.9.72022-06-28Update and fixed dependency node modules.
0.9.62019-01-07Update dependency node modules (lodash
0.9.52018-07-27Update dependency node modules
0.9.32017-08-18add command from AsAdmin and Maven if the verbose is switch on.
0.9.22017-02-28fix: port numbers as integers
0.9.12016-01-16delete the code of the next version. It is not complete.
0.9.02017-01-06Simplify the app. Delete the action config.
0.8.02016-11-28add the task test.
0.7.32016-11-21fixed: normilze path names.
0.7.22016-10-07fixed default timeout and improve readme.
0.7.12016-10-07fixed the timeout for commands and improve the documentation of the actions.
0.7.02016-07-31add jdbc action
0.6.32016-05-18fixed: add the dot
0.6.22016-05-18fixed: read the config settings
0.6.12016-05-18fixed: execute a command on windows.
0.6.02016-05-18read the command.asadmin command from the server-config.json. If a platform depended command is execute, then it can be separated between win32 and unix. See the server-config.json example
0.5.32016-03-04show environments, some fixes.
0.5.22016-02-24add the environments without modify the name.
0.4.02016-02-11Update node module "lodash"
0.3.02016-02-11add the missing actions "restart" and "redeploy"
0.2.22016-02-10Improve conversion rules for environment name.
0.2.12016-02-10Environment variables for executing the application server.
0.1.12016-02-09show the current directory
0.1.02016-02-09add setting.xml for maven
0.0.32016-02-01fixed the server base port
0.0.2Improve documentation
0.0.12016-01-11Initial commit (all started here)

License

The MIT License (MIT)

Copyright (c) 2017 BlueSkyFish

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Third Party

All company, brand and product names are trademarks of their respective owners.

0.9.7

2 years ago

0.9.6

5 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.3

7 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago