maven - How can I use a secure file in a CircleCI build? -
maven - How can I use a secure file in a CircleCI build? -
i trying build project on circleci needs access secure file. cannot utilize environment variable, must in form of file. in case maven settings.xml
file, there other utilize cases. can do?
there quite few solutions problem:
file environment variable
if contents of file short (just password example), can store entire file environment variable, , add together line circle.yaml build file:
echo $secure_file > mysecurefile
variable substitution
if contents of file large, little portion of file secure, can store file in code repository, , utilize sed replace fixed string environment variable, this:
sed -e s/secure_password/${secure_password}/g mysecurefile.tmpl > mysecurefile
encrypt file
you can encrypt config file , check source repository, store decryption key environment variable. decrypt during build process.
maven settings.xml special case
for special case of maven settings.xml files, can utilize environment variables in settings.xml, can this:
store settings.xml in conf/settings.xml replace secure text this:${env.my_secure_text}
set my_secure_text
in circle ci configuration in circle.yaml, add together '-s conf/settings.xml' maven build commands. maven maven-3 circleci
Comments
Post a Comment