Last active
January 5, 2019 17:00
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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