A build definition file may need to include sensitive information, such as SSH keys or passwords that are needed to access private resources, but you do not want to include these in plain text in your build definition file. You can encrypt this sensitive information, and then use the encrypted value in a secure element in the build definition file.
You can use either the Cloud Platform interface or the command line to encrypt your variables and keys that are to be stored with your codebase. Follow the procedures based on your selected method:
Click More Links.
To encrypt an SSH private key, execute the following command, replacing [~/.ssh/id_rsa] with the actual path to the SSH private key you want to encrypt:
cat [~/.ssh/id_rsa] | pipelines encrypt -To encrypt arbitrary text (such as a password), use the following command, replacing my password (but not the enclosing quotation marks) with your text:
echo "my password" | pipelines encrypt -
You are now ready to add your encrypted information to your code repository.
Regardless of what encrypted information you are adding to your codebase, after adding the information, be sure to commit your changes to your code repository.
Encrypted SSH keys should be stored in the ssh-keys element of your acquia-pipelines.yaml file with a name of your choosing. For example:
ssh-keys:
mykey:
secure: 2acIshWAndTh1sG0esOn . . .The decrypted SSH private key will then be available during your build.
The default format of SSH keys generated by OpenSSH version 7.8 or later is incompatible with Pipelines. For more information, see this known issue.
Encrypted variables should be stored in the variables element of your acquia-pipelines.yaml file with a variable name of your choosing. For example:
variables:
global:
PASSWORD:
secure: 2acqDl…The decrypted value will be available as an environment variable during your build.
For more information about the acquia-pipelines.yaml file, see Creating and managing your build definition file. For more information about default environment variables available to you, see Default environment variables in Pipelines. Example build definition files are available at Example Pipelines build definition files.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
To encrypt an SSH private key, execute the following command, replacing [~/.ssh/id_rsa] with the actual path to the SSH private key you want to encrypt:
cat [~/.ssh/id_rsa] | pipelines encrypt -To encrypt arbitrary text (such as a password), use the following command, replacing my password (but not the enclosing quotation marks) with your text:
echo "my password" | pipelines encrypt -
You are now ready to add your encrypted information to your code repository.
Regardless of what encrypted information you are adding to your codebase, after adding the information, be sure to commit your changes to your code repository.
Encrypted SSH keys should be stored in the ssh-keys element of your acquia-pipelines.yaml file with a name of your choosing. For example:
ssh-keys:
mykey:
secure: 2acIshWAndTh1sG0esOn . . .The decrypted SSH private key will then be available during your build.
The default format of SSH keys generated by OpenSSH version 7.8 or later is incompatible with Pipelines. For more information, see this known issue.
Encrypted variables should be stored in the variables element of your acquia-pipelines.yaml file with a variable name of your choosing. For example:
variables:
global:
PASSWORD:
secure: 2acqDl…The decrypted value will be available as an environment variable during your build.
For more information about the acquia-pipelines.yaml file, see Creating and managing your build definition file. For more information about default environment variables available to you, see Default environment variables in Pipelines. Example build definition files are available at Example Pipelines build definition files.
If this content did not answer your questions, try searching or contacting our support team for further assistance.