Skip to content
Sven Oppermann edited this page Feb 27, 2018 · 20 revisions

PACIFy has the following commands:

If the command runs successfully PACIFy will return with 0, otherwise with 1. You can display the usage information by calling:

java -jar pacify.jar --help

For almost all commands you have to specify a resolver. What a resolver is and how it work's have a look at link.

validate

This command is used to validate a package and to check if all properties can be resolved. But it doesn't configure the package.

java -jar pacify.jar                                            \
      validate                                                  \
      --packagePath=/share/app/deployment-package-app-v1.0      \
      --resolvers=FileResolver                                  \
      -RFileResolver.file=prod.properties 
Parameter Mandatary Default Description
-p, --packagePath yes Which package do you want to validate?
-r, --resolvers yes How do you want to resolve the properties?
-R yes Parameters which will be forwarded to the resolver.

validateMarkerFiles

Same as validate but without the property resolution check. This command is useful for nightly builds where you don't have any properties and only want to check if the marker files are correct and the placeholder exists.

java -jar pacify.jar                                            \ 
      validateMarkerFiles                                       \
      --packagePath=/share/app/deployment-package-app-v1.0     
Parameter Mandatary Default Description
-p, --packagePath yes Which package do you want to validate?

preConfigure

If you call the replace command pacify want's to replace all placeholders. Somethimes you only want to replace some of them, but not all. This command replaces only that placeholder where the property is defined in the resolver(s) and adjusts the pacify configuration file.

 java -jar pacify.jar                                           \ 
      preConfigure                                              \
      --packagePath=/share/app/deployment-package-app-v1.0      \
      --resolvers=FileResolver                                  \
      -RFileResolver.file=preConfigure.properties 
Parameter Mandatary Default Description
-p, --packagePath yes Which package do you want to configure?
-c, --copyTo no If used, the package will first be copied and the configuration will be done on the copy.
-r, --resolvers yes How do you want to resolve the properties?
-R yes Parameters which will be forwarded to the resolver.

createPropertyFile

If you call this command, PACIFy will fetch all properties from the given resolvers resolves the references and writes the result to STDOUT or a file.

There are two main reasons for this command:

  1. PACIFy has many way's to resolve properties and sometimes it's not easy to predict the final value.
  2. You have to configure a package in your DMZ and have to resolve your properties with a resolver which uses a webservice and there is a firewall. In this scenario, create a property file with this command, copy it to the DMZ and configure your package with the Fileresolver.

Call:

java -jar pacify.jar                                            \ 
      createPropertyFile                                        \
      --resolvers=CmdResolver,FileResolver                      \
      -RCmdResolver.log.level=DEBUG                             \
      -RFileResolver.file=prod.properties 
Parameter Mandatary Default Description
-d, --destinationFile no If you don't specify this the output will be written to STDOUT otherwise to this file.
-e, --targetEncoding no UTF-8 The encoding of the output.
-m, --fileMode no 400 If you write it to a file, which file mode should the file have?
-op, --outputPrefix no If you want to prefix every line, set this value. For parsing purposes.
-r, --resolvers yes How do you want to resolve the properties?
-R yes Parameters which will be forwarded to the resolver.

replace

PACIFy's main goal is to configure a package and this command is exactly for that. Before he is doing anything, it will validate.

java -jar pacify.jar                                            \ 
      replace                                                   \
      --packagePath=/share/app/deployment-package-app-v1.0      \
      --resolvers=CmdResolver,FileResolver                      \
      -RCmdResolver.log.level=DEBUG                             \
      -RFileResolver.file=prod.properties 
Parameter Mandatary Default Description
-p, --packagePath yes Which package do you want to configure?
-c, --copyTo no If used, the package will first be copied and the configuration will be done on the copy.
-r, --resolvers yes How do you want to resolve the properties?
-R yes Parameters which will be forwarded to the [resolver] (https://github.com/cecom/PACIFy/wiki/4.-Property-Resolvers).

showUsedProperties

If you want to see all properties which a package will ask for you can use this command.

java -jar pacify.jar                                            \  
      showUsedProperties                                        \
      --packagePath=/share/app/deployment-package-app-v1.0
Parameter Mandatary Default Description
-p, --packagePath yes From which package do you want to know the used properties?
-d, --destinationFile no If you don't specify this the output will be written to STDOUT otherwise to this file.
-e, --targetEncoding no UTF-8 The encoding of the output.
-op, --outputPrefix no If you want to prefix every line, set this value. For parsing purposes.

Clone this wiki locally