You really want the variation with the public-private-keypair. The password variation should only be used for testing.
This is more or less just for testing purposes. For production quality we want asymetric encryption, since then every third party can encrypt their secret stuff (passwords for example) with the build server's public key, so that the build server is able to decrypt it.
echo 'MySecret' | openssl enc -base64 -e -aes-256-cbc -pass pass:mySecretPass
The concrete encryption results differ from every run - this is by purpose - don't get confused!