Space Automation automation Help

Secrets and Parameters

Secrets and parameters are project-wide variables that you can use in your Automation scripts:

  • Secrets – variables stored in the encrypted format. For example, credentials to an external service.

  • Parameters – variables that are frequently used throughout your Automation scripts. For example, a URL of an exteral service.

Creating secrets and parameters

  1. Open the desired project.

  2. On the project sidebar menu, choose Project Settings → Secrets and Parameters.

  3. Click New secret or New parameter to create a parameter or a secret correspondingly.

  4. Specify

    • Key: a variable name. You will use this name to reference this variable in your scripts.

    • Value: a variable value.

    Note the limitations:

    • Secrets and parameters exist only in a scope of a particular project. So, if you create a secret or a parameter in one project, you cannot use them in other projects.

    • Keys of secrets and parameters must be unique within a project.

    • A key must be no longer than 128 characters and can only contain alphanumeric characters ([a-z], [A-Z], [0-9]), dashes (-), or underscores (_).

    • Max parameter value size is 65 KB.

    • Max secret value size is 40 KB.

Secrets and parameters

Using secrets and parameters

  1. Using Secrets and Params, assign a secret or a parameter value to a container environment variable.

  2. Use the environment variable inside shellScript or kotlinScript.

  3. Make sure your script does not print the value. Otherwise, it will be visible in job logs.

For example:

job("Secrets and params") { container("ubuntu") { env["URL"] = Params("bintray-repo-url") env["PSWRD"] = Secrets("bintray-repo-password") shellScript { content = """ echo My password for; printenv URL echo is; printenv PSWRD """ } } }
Last modified: 21 July 2020