Skip to content

Instantly share code, notes, and snippets.

@GuruCharan94
Last active January 5, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuruCharan94/d8f35cb1b712c58da6d6415169b8e30c to your computer and use it in GitHub Desktop.
Save GuruCharan94/d8f35cb1b712c58da6d6415169b8e30c to your computer and use it in GitHub Desktop.
Spinning up MongoDB, PostgreSQL, SQL Server, MySQL and Redis on Azure DevOps Hosted VS2017Agent
# Install Nuget CLI using the Nuget Installer Task before running this
nuget install redis-64 -excludeversion
redis-64\tools\redis-server.exe --service-install; redis-64\tools\redis-server.exe --service-start
# Setup PostgreSQL, MySQL, MongoDB using Chocolatey
choco feature enable -n=allowGlobalConfirmation
choco install mongodb --version 3.6.0
choco install mysql --version 5.7.18
$PGPASSWORD = "Password12!"
$PGUSER = "Postgres"
choco install postgresql --version 9.6.8 --params "/Password:$PGPASSWORD"
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
refreshenv
mysql -e "create database test;" --user=root
createdb test
mkdir D:\data\db
# Start MongoDB as run as Background Process
Start-Process "C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe" -ArgumentList "--dbpath D:\data\db" -NoNewWindow -RedirectStandardOutput log.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment