This module facilitates the users in configuring their environment required for their project. Let us see how to configure the environment, how to delete the unwanted environment, how to use the list option for listing the available environments in upcoming topics.
The help command guides the users regarding the purpose of the module, its alternative parameters that are used in declaration. It highlights the three functions of environment configuration which are list, configure, delete. It also specifies the syntax for using three major functions. The syntax used for declaring the help is shown below:
ptconfigure envconfig help
The following screen shot depicts pictorially about the working of help command.
kevell@corp:/# ptconfigure envconfig help
******************************
This command is part of a default Module and provides you with a method by which you can
configure environments for your project from the command line. Currently compliant with
both ptdeploy and ptconfigure.
EnvironmentConfig, environmentconfig, environment-config, envconfig, env-config
- list
List current environments
example: ptconfigure envconfig list --yes
- list-local
List current local environments
example: ptconfigure envconfig list-local --yes
- configure, config
Configure bespoke environments for your project to use
example: ptconfigure envconfig config
# below to create an empty environment to add instances to
example: ptconfigure envconfig config --yes
--keep-current-environments # do not overwrite the current environments stored in papyrusfile
--no-manual-servers # so it will not ask you to interactively enter connection details of instances
--add-single-environment # otherwise it will loop for more until you specify not to
--environment-name="some-name" # name of the environment to create
--tmp-dir=/tmp/ # we're deprecating this soon
- configure-default, config-default
Configure default environments for your project to use
example: ptconfigure envconfig config-default
example: ptconfigure envconfig config-default --yes --environment-name="local-80/local-8080"
- delete, del
Configure the environments for your project to use
example: ptconfigure envconfig delete
example: ptconfigure envconfig del --environment-name="staging"
------------------------------
End Help
******************************
For the purpose of configuring the environments the user can use the following command:
ptconfigure envconfig config
After inputting the command above the following operations takes place as shown:
Step 1: Configure Environments Here? (Y/N)
The user have to input Y or N.
Step 2: Use existing environment Settings? (Y/N)
The user have to input Y or N.
If the user input as Y it will proceed with already existing.
If they input as N, it will asks information regarding the environment as
Value for: Name of the environment
Value for: Default temp dir(Location)
After the above steps, the user have to input the following details:
Enter target?
Enter user?
Enter password?
Add Another Server? (Y/N)
The user have to input Y or N.
Finally, the environment configuration gets success as depicted in the below screenshot.
kevell@corp:/# ptconfigure envconfig config
Configure Environments Here? (Y/N)
Y
Environment 1 :
Default Settings for Any App not setup for environment enter them now.
Value for: Name of this Environment
kevells
Value for: Default Temp Dir (should usually be /tmp/)
Enter Servers - this is an array of entries
Enter target ?
/home/kevells
Enter user ?
kevells
Value for: Default Temp Dir (should usually be /tmp/)
Enter Servers - this is an array of entries
Enter target ?
/home/kevells
Enter user ?
kevells
Enter password ?
123456
Add Another Server? (Y/N)
N
******************************
Success
In Environment Configuration
******************************
While configuring an environment, if the user wish to configure with current environment , they can use the following command:
ptconfigure envconfig config --keep-current-environments
After inputting the command above, it will asks the following details as shown in the tabular format:
| Parameters | Options | Comments |
|---|---|---|
| Configure Environments Here? (Y/N) | Y | If the user wish to configure the environments at the current environment they can input as Y |
| Configure Environments Here? (Y/N) | N | If the user doesn’t wish to configure the environments at the current environment they can input as N |
| Use existing environment settings? (Y/N) | Y | If the user wish to use the existing environment settings they can input as Y. |
| Use existing environment settings? (Y/N) | N | If the user doesn’t wish to use the existing environment settings they can input as N. |
| Do you want to add another environment? (Y/N) | Y | If the user wish to add another environment,they can input as Y. |
| Do you want to add another environment? (Y/N) | N | If the user doesn’t wish to add another environment, they can input as N.| |
The following screenshot pictorially represents the above mentioned process:
kevell@corp:/# ptconfigure envconfig config --keep-current-environments
Configure Environments Here? (Y/N)
Y
Use existing environment settings? (Y/N)
Y
Do you want to add another environment? (Y/N)
N
******************************
Success
In Environment Configuration
******************************
If the user needs to delete the environment configuration, they can input the following command:
ptconfigure envconfig del --environment-name="kevells"
The user can specify the name of the environment they wish to delete as shown above.
After inputting the command above, it will ask
Step 1: Delete Environments Here?
and shows a warning message as
WARNING: Deleting an environment from papyrus is final. You may be looking for boxify box-destroy instead (Y/N)
The user has to specify Y or N
Step 2: Environment Kevells(Name of the specified environment that is supposed to delete) found. Are you sure want to delete it? (Y/N)
The user has to specify Y or N
Finally, the specified environment gets deleted as shown in the screenshot.
kevell@corp:/# ptconfigure envconfig del --environment-name="kevells"
Delete Environments Here?
WARNING: Deleting an environment from papyrus is final. You may be looking for boxify box-destroy instead (Y/N)
Y
Environment kevells found. Are you sure you want to delete it? (Y/N)
Y
[Pharaoh Logging] Removing environment kevells.
******************************
Success
In Environment Configuration
******************************
If the user wish to view the list of details regarding the environment configuration, they can input as shown: .. code-block:: bash
ptconfigure envconfig list –yes
After inputting the command above, it will display the output as shown in the screenshot:
kevell@corp:/# ptconfigure envconfig list --yes
******************************
array(0) {
}
In Environment Configuration
******************************
Instead of envconfig the following parameters can be used in declaration: