Encrypt Travis variables with this simple wizard for Windows
Download the .bat
file and run it. Ensure that Ruby is installed.
@echo off | |
title Travis Variable Encryption Wizard | |
cls | |
echo Welcome to the Travis Variable encryption wizard | |
echo An installation of Ruby is required to continue | |
echo Press enter to confirm that Ruby is installed... | |
pause>nul | |
:start | |
echo. | |
set /p updategems=Update Ruby Gems? (Y/n): | |
IF /I %updategems%=="y" ( goto updateruby ) | |
IF /I %updategems%=="" ( goto updateruby ) | |
goto afterupdateruby | |
:updateruby | |
echo Updating Ruby Gems... | |
gem update --system>nul | |
echo Update Complete | |
:afterupdateruby | |
echo. | |
set /p installthegem=Install Travis Ruby Gem (if not already)? (Y/n): | |
IF /I %installthegem%=="y" ( goto installtravis ) | |
IF /I %installthegem%=="" ( goto installtravis ) | |
goto afterinstalltravis | |
:installtravis | |
echo Installing Travis Ruby Gem... | |
gem install travis>nul | |
echo Installation Complete | |
:afterinstalltravis | |
echo. | |
set /p projectdir=Enter the directory of your repository: | |
set /p varname=Enter the name of the new variable: | |
set /p varcontent=Enter the content of the new variable: | |
set /p autoadd=Automatically append the variable to the .travis.yml file? (y/N): | |
echo. | |
IF /I %autoadd%=="y" ( goto addvalauto ) | |
echo Generating key and adding to .travis.yml file... | |
travis encrypt %varname%="%varcontent%" | |
echo Generation Complete | |
goto afteraddvalauto | |
:addvalauto | |
echo Generating key and adding to .travis.yml file... | |
travis encrypt %varname%="%varcontent%" --add | |
echo Generation Complete | |
:afteraddvalauto | |
set /p createanother=Encrypt another variable? (Y/n): | |
IF /I %createanother%=="y" ( goto start ) | |
exit 0 |