Configuration on the command line
The
script offers many options to edit environment definitions.hop-conf
Creating an environment
$ sh hop-conf.sh \
--environment-create \
--environment hop2 \
--environment-project hop2 \
--environment-purpose=Development \
--environment-config-files=/home/user/projects/hop2-conf.json
Creating environment 'hop2'
Environment 'hop2' was created in Hop configuration file <path-to-hop>/config/hop-config.json
2021/02/01 16:37:02 - General - ERROR: Configuration file '/home/user/projects/hop2-conf.json' does not exist to read variables from.
Created empty environment configuration file : /home/user/projects/hop2-conf.json
hop2
Purpose: Development
Configuration files:
Project name: hop2
Config file: /home/user/projects/hop2-conf.json
As you can see from the log, an empty file was created to set variables in:
{ }
Setting variables in an environment
This command adds a variable to the environment configuration file:
$ sh hop-conf.sh --config-file /home/user/projects/hop2-conf.json --config-file-set-variables DB_HOSTNAME=localhost,DB_PASSWORD=abcd
Configuration file '/home/user/projects/hop2-conf.json' was modified.
If we look at the file
we’ll see that the variables were added:hop2-conf.json
{
"variables" : [ {
"name" : "DB_HOSTNAME",
"value" : "localhost",
"description" : ""
}, {
"name" : "DB_PASSWORD",
"value" : "abcd",
"description" : ""
} ]
}
Please note that you can add descriptions for the variables as well with the
option. Please run hop-conf without options to see all the possibilities.--describe-variable
Projects Plugin configuration
There are various options to configure the behavior of the
plugin itself. In Hop configuration file Projects
we can find the following options:hop-config.json
{
"projectMandatory" : true,
"environmentMandatory" : false,
"defaultProject" : "default",
"defaultEnvironment" : null,
"standardParentProject" : "default",
"standardProjectsFolder" : "/home/matt/test-stuff/"
}
Option | Description | hop-conf option |
---|---|---|
projectMandatory | This will prevent anyone from using hop-run without specifying a project |
|
environmentMandatory | This will prevent anyone from using hop-run without specifying an environment |
|
defaultProject | The default project to use when none is specified |
|
defaultEnvironment | The default environment to use when none is specified |
|
standardParentProject | The standard parent project to propose when creating new project |
|
standardProjectsFolder | The folder to which you’ll browse by default in the GUI when creating new projects |
|