Siirry pääsisältöön

Command line 26.03

Avaa ChatGPT:ssä

The bbjship command line manages BBjShip on the BBj machine. It's in <BBj home>/plugins/webforj-bbjship, as bbjship.cmd on Windows. Every command runs inside BBjServices, so BBjServices must be running for every command.

bbjship <group> <command> [options]

Commands​

CommandDescription
remote enable [--port PORT] [--ssl-port PORT]Enables or updates the deployment endpoint and prints its addresses.
remote disableRemoves the deployment endpoint. Deployed apps keep running.
remote statusPrints the endpoint addresses and whether development runs are enabled.
apps deploy ARCHIVEDeploys a deployment archive.
apps list [--long]Lists the apps BBjShip deployed.
apps undeploy NAME, apps undeploy --allRemoves one or every app BBjShip deployed.
development enable, development disableTurns development runs on or off on this machine.
reset [--yes] [--properties FILE]Removes every app and everything BBjShip set up.

Shared options​

SettingDefaultDescription
--username USERUnsetBBj administrator user name.
--password PASSWORDUnsetBBj administrator password.
--password-stdinOffReads the password from the first line of standard input. Not available on Windows.
--help, -hPrints the usage of the command line or of one command.
--version, -VPrints the BBjShip version.

A password given with --password is visible to other users of the machine in the process list while the command runs. On macOS and Linux, a script passes the password on standard input instead:

printf '%s\n' "$PASSWORD" | bbjship remote enable --username admin --password-stdin

On every system, the variables keep the password out of the command line:

WEBFORJ_BBJ_USERNAME=admin WEBFORJ_BBJ_PASSWORD="$PASSWORD" bbjship remote enable

On Windows, standard input isn't available, so --password-stdin ends with exit code 2. Pass the password as a value or through the variables:

bbjship.cmd remote enable --username admin --password <value>

Giving both --password and --password-stdin, a user name without a password, or a password without a user name ends with exit code 2 and a message that names what to specify.

Without credentials, the command uses the factory account admin with admin123 and prints a warning.

Environment variables​

VariableDefaultDescription
WEBFORJ_BBJ_USERNAMEUnsetUser name when --username is absent.
WEBFORJ_BBJ_PASSWORDUnsetPassword when neither --password nor --password-stdin is given.
NO_COLORUnsetTurns off colored output.

Remote​

The remote commands manage the deployment endpoint.

remote enable​

bbjship remote enable [--port PORT] [--ssl-port PORT]

Enables or updates the deployment endpoint and prints its addresses.

SettingDefaultDescription
--port PORT8888HTTP port of the BBjServices web server for the endpoint.
--ssl-port PORTNoneSSL port of the BBjServices web server for the endpoint. Without it, the endpoint has no HTTPS address.

The ports must be ports the BBjServices web server already listens on. Otherwise remote enable ends with exit code 1, names the port that doesn't answer, and keeps the previous endpoint.

remote disable​

bbjship remote disable

Removes the deployment endpoint. Deployed apps keep running.

Builds can't deploy

remote disable removes the deployment endpoint. Builds and CI jobs that deploy to it fail until you run remote enable again. Note the ports and the endpoint address before you disable it. Deployed apps keep running.

remote status​

bbjship remote status

Prints the endpoint addresses and whether development runs are enabled.

$ bbjship remote status
Enabled http://localhost:8888/webforj-bbjship
Enabled https://localhost:8443/webforj-bbjship
Development runs disabled

Apps​

The apps commands list and remove only apps BBjShip deployed. Apps registered in Enterprise Manager aren't affected.

apps deploy​

bbjship apps deploy ARCHIVE

Deploys a deployment archive. apps deploy installs an archive written by bbj-package, without the deployment endpoint. The filename without .zip is the publish name. BBjServices reads the archive, so the operating system user of BBjServices needs read access to it.

$ bbjship apps deploy inventory.zip
Deployed inventory /webapp/inventory
Replaces the app

Deploying an archive under the name of an app that's already deployed replaces that app. The previous deployment folder is removed and the running sessions of the app end. Keep the previous archive if you may need to go back.

apps list​

bbjship apps list [--long]

Lists the apps BBjShip deployed.

SettingDefaultDescription
--long, -lOffAdds the deployment folder and the class folders of each app.
$ bbjship apps list
NAME URL
inventory /webapp/inventory

apps undeploy​

bbjship apps undeploy NAME
bbjship apps undeploy --all

Removes one or every app BBjShip deployed.

SettingDefaultDescription
--allOffUndeploys every app BBjShip deployed.
Can't be undone

apps undeploy removes the app from Enterprise Manager, ends its running sessions, and deletes its deployment folder. apps undeploy --all does this for every app BBjShip deployed. This can't be undone. Keep the deployment archive of each app, for example target/bbj/<publish name>.zip, so you can deploy it again.

Development​

Development runs are off on a new installation, and the first webforj:watch on the same machine turns them on. bbjship development disable turns them off until the next webforj:watch on this machine turns them on again. A development run from another machine is refused, because the setup it runs first works on the BBj machine only.

development enable​

bbjship development enable

Turns on development runs on this machine.

development disable​

bbjship development disable

Turns off development runs on this machine.

Reset​

bbjship reset [--yes] [--properties FILE]

reset undeploys every app BBjShip deployed, removes the deployment endpoint and the development switch, restores the BBjServices properties file a development run changed, and deletes the files BBjShip wrote. The command never stops BBjServices. When it restored the properties file, restart BBjServices to apply it. The plugin folder stays.

SettingDefaultDescription
--yesOffSkips the confirmation.
--properties FILE<BBj home>/cfg/BBj.propertiesBBjServices properties file that reset restores.

The command prints what it does and asks for confirmation unless --yes is given. On Windows, reset without --yes ends with exit code 2 before it logs in.

Back up first

reset can't be undone. It removes the folder of every app BBjShip deployed and ends their running sessions. Before you run it, keep the deployment archive of each app, for example the target/bbj/<publish name>.zip of the build, and back up <BBj home>/cfg/BBj.properties. When a copy of the file was kept in the BBjShip runtime folder, reset puts that copy back over cfg/BBj.properties, so any change you made to the file after the first development run is lost. Restart BBjServices afterwards to apply the restored Java settings.

Exit codes​

CodeMeaning
0The command succeeded.
1The command failed and printed the cause, or reset was cancelled.
2The arguments are invalid, or the command needs standard input on Windows. The message shows what to specify.

Troubleshooting lists the messages and what to do about each.