Universal Access to the Plugins Directory

4 minute read

A plugin is a collection of one or more features, or a third-party integration or tool that can be added to CloudBees Flow. The CloudBees Flow server installs all plugins into a configurable location named the plugins directory. This directory must be readable by the web server.

There are two ways to make the plugins directory readable by the web server. You can configure the CloudBees Flow server, and web servers to point to a central network location, or you can replicate the contents of the plugins directory on remote web servers.

Replicating the Plugin Directory on Remote Systems

Use this procedure to keep the Plugins directory in its default server location and replicate the contents to remote agents and web servers.

This approach requires you to manage multiple plugin directories. Every time a new plugin is installed on the CloudBees Flow server, you must synchronize the changes across all remote copies of the directory. Only replicate the Plugins directory if you cannot use or configure a central network location.
  • Copy the plugins directory to remote web servers using any file copy mechanism.

  • The copied plugins directories must be readable by only the remote web servers.

  • Plugins should be copied to a plugins subdirectory within the data directory for each remote web server.

  • Every time the CloudBees Flow server Plugins directory is updated, you must synchronize the changes across all remote copies.

Mounting network plugin share files

This section explains how to mount network plugins share files when you are setting up CloudBees Flow components for high availability. This section contains the steps to set up a CloudBees Flow server cluster (two load-balanced CloudBees Flow servers and two load-balanced CloudBees Flow web servers) sharing the same plugin folders (a “network plugins share”).

This setup consists of the following main steps:

Using the Remote Plugins Folder

This section describes how to make the CloudBees Flow components (CloudBees Flow server, CloudBees Flow web server, and agent) use the remote mymountpoint/plugins as the plugins folder.

The Plugins directory in the Automation Platform Administration > Server > Settings page (such as C:/ProgramData/Electric Cloud/CloudBees Flow Automation Platform/plugins on Windows or /opt/electriccloud/electriccommander/plugins on Linux) need not be changed if the CloudBees Flow server is standalone and is using its local plugins folder. This the default location where the plugins are installed by the CloudBees Flow server (the DATA_DIR/plugins folder by default).

If the CloudBees Flow server is clustered, you should use the plugins directory from a network plugins share and copy the contents of the DATA_DIR/plugins folder (and subfolders) from the CloudBees Flow node 1 to this network plugins share. As an example on Windows, define the network plugins share from a network UNC path //f2/scratch/chronic3plugins.

You can also set this network plugins share using the following ectool commands (after logging in via ectool ):

ectool --server FLOW_SERVER_LOAD_BALANCER CloudBees Flow serverlogin admin changeme ectool setProperty "/server/settings/pluginsDirectory" "/mymountpoint/plugins"

If the clustered CloudBees Flow server is on Linux, you can just mount the plugins NFS share (for example, NFS_HOST:/EF/Plugins ) to the DATA_DIR/plugins in /etc/fstab and avoid changing /server/settings/pluginsDirectory :f

Using the same network plugins share

If the local or remote web server use the same network plugins share as the CloudBees Flow server, then run the command described below on the web server.

The web server can be local or remote to the CloudBees Flow server. This updates the DATA_DIR/apache/conf/httpd.conf file (for example, on Linux, it is /opt/electriccloud/electriccommander/apache/conf/httpd.conf by default).

Linux Web Servers

ecconfigure --webPluginsDirectory PLUGINS_SHARE_FOLDER

For example:

ecconfigure --webPluginsDirectory /mymountpoint/plugins

Otherwise, if you are using Linux CloudBees Flow web servers, you can just mount the network plugins share to the DATA_DIR/plugins folder. Then you do not need to run the ecconfigure –webPluginsDirectory command.

Windows Web Servers

If the CloudBees Flow web servers are on Windows, you must use the UNC path. For example:

ecconfigure --webPluginsDirectory //f2/scratch/chronic3plugins

Running the ecconfigure –webPluginsDirectory command updates the DATA_DIR/apache/conf/httpd.conf.

The ecconfigure --agentPluginsDirectory command updates the DATA_DIR/conf/agent.conf file and the DATA_DIR/conf/agent/agent.properties file. But note that these entries are no longer used for most plugins.

Specifying the Network Plugins Directory

Linux CloudBees Flow Servers

If the CloudBees Flow server is on Linux, run the following command to specify a network plugins directory, for the agent on the same machine as the CloudBees Flow server. This updates the /opt/electriccloud/electriccommander/conf/agent.conf file:

ecconfigure --agentPluginsDirectory /mymountpoint/plugins

Windows CloudBees Flow Servers

If the CloudBees Flow server is on Windows, run the following command to specify a network plugins directory, for the agent on the same machine as the CloudBees Flow server. This updates the DATA_DIR/conf/agent.conf file:

ecconfigure --agentPluginsDirectory //f2/scratch/chronic3plugins

Run the following command if you will install remote Windows agents or web servers. That is, not on the same machine as the CloudBees Flow server. (For the web server or agent on the same machine as the CloudBees Flow server, this property is not used):

ectool --server localhost setProperty "/server/Electric Cloud/windowsPluginsShare" //winhost/mymountpoint/plugins

Installing Remote Linux Agents

Run the following command if you install remote Linux agents or web servers. That is, not on the same machine as the CloudBees Flow server. For the web server or agent on the same machine as the CloudBees Flow server, this property is not used:

ectool --server localhost setProperty "/server/Electric Cloud/unixPluginsShare" /mymountpoint/plugins

You can see these updates in the Automation Platform UI on the Administration > Server > Custom Server Properties > Electric Cloud page. You can simply use the data directory, because then the network plugins share is relative to the data directory (DATA_DIR/plugins):

Restarting the CloudBees Flow Web Server

On each CloudBees Flow web server, if you run any of the above ecconfigure commands, you must restart it as sudo using:

sudo /etc/init.d/commanderApache restart

Running commanderApache using sudo does not change the permissions of the files in DATA_DIR/apache/logs such as the access.log, error.log, and httpd.pid files to root. They will still be owned by the user specified in the --unixServerUser option (the service user) used when the web server was installed.