Tokens

Tokens are parameters that differ between environments. Tokens replace values in a tokenized file with the specific definition for the target environment. For artifact definitions that differ per environment, set the artifact definition as a tokenized file.
ra55
Tokens are parameters that differ between environments. Tokens replace values in a tokenized file with the specific definition for the target environment. For artifact definitions that differ per environment, set the artifact definition as a tokenized file.
Create a Token
To define a Parameter with a value that differs per Environment, create a Token.
For more detailed information about working with tokens, creating custom masks, and other details, see Tokens Best Practices.
Follow these Steps:
  1. Go to
    Administration
    ,
    Token Management
    .
  2. Select the
    Application
    .
  3. Click
    New
    .
    The
    Create Token
    box opens.The following screen capture shows the
    Create Token
    box:
    Shows an example of the token creation menu.
  4. Specify the required information.
    The token uses the default value when the environment does not have a specific value.
    The Token Mask is a regular expression that enforces validation on token values.
    Nolio Release Automation
    includes several predefined token masks.
  5. Click
    Save
    .
    Nolio Release Automation
    adds the token to application. Define the token values for the environments. For more information, see Manage Environments.
Tokens and Artifacts
All tokenized artifact versions from the same artifact definition are modified automatically for the deployment.
To define the token, use the token format in a text file.
Default:
@@
TOKEN
@@
Example:
The following properties file represents a tokenized artifact where the database host, port, name, user, and password are tokens:
# Data Management Server props #data.management.server=localhost #data.management.port = 12099 # Database props data.management.database.host = @@[email protected]@ data.management.database.port = @@[email protected]@ data.management.database.name = @@[email protected]@ data.management.database.user = @@[email protected]@ # The DB password shall be encrypted. Please use the encrypt_password.bat/sh utility to encrypt the password. data.management.database.pwd = @@[email protected]@ data.management.database.create = @@[email protected]@ # Scanners props data.management.servers.scanner.interval.seconds=15 #Uncomment and edit following lines to be able to log in with your Active Directory domain user. #NOTE: User will see nothing in ASAP, unless he is a member of some security group in #the domain, which was previously imported to ASAP, and granted with permissions #to some application. #NOTE: only one type of LDAP integration, General or Active Directory, can be enabled at the same time. #use.active.directory.authentication=true #use.active.directory.domain=<domain name, e.g: mycompany.com> #use.active.directory.url=<ldap url, e.g: ldap://server.domain.com> #use.active.directory.user.username=<username of a domain user that has permissions to see other users, e.g:[email protected]> #use.active.directory.user.password=<password of the user defined in use.active.directory.user.username> #Uncomment and edit following lines to be able to log in with your a user defined in your local LDAP. #NOTE: User will see nothing in ASAP, unless he is a member of some security group in #the domain, which was previously imported to ASAP, and granted with permissions #to some application #NOTE: only one type of LDAP integration, General or Active Directory, can be enabled at the same time. #use.general.ldap.authentication=true #use.general.ldap.url=<ldap url, e.g: ldap://localhost:10389> #use.general.ldap.user.fqdn=<fully qualified DN of domain user that has permissions to see other users, e.g:uid=admin,ou=system> #use.general.ldap.user.password=<password of the user defined in use.general.ldap.user.fqdn>
Define Tokens in a Manifest File
To create a set of tokens and defines the values, use an XML manifest file.
Follow these steps:
  1. Go to
    Administration
    ,
    Token Management
    .
  2. Select the
    Application
    .
  3. Click the
    Manifest
    button, and click
    Load Manifest
    .
  4. Click
    Browse
    , select the XML manifest file, and click
    Open
    .
  5. Click
    Save
    Token definitions and all environments values from the manifest file are applied.
    .
The following example shows the XML format to create tokens:
<TokensManifest> <tokens-definition> <token name="db.user1" type="String" mandatory="true" defaultValue="Guest"/> <token name="db.password1" type="Password" mandatory="false" defaultValue="123456"/> <token name="db.user2" type="String" mandatory="true" defaultValue="Guest2"/> </tokens-definition> <values> <environment name="environmentABC"> <token name="db.user1" value="Peter" /> </environment> <environment name="Environment for Default Architecture"> <token name="db.user1" value="Peter" /> <token name="db.user2" value="Eric" /> </environment> <environment name="environmentDEF"> <token name="db.user1" value="Evan" /> </environment> </values> </TokensManifest>