Skip to content

Instantly share code, notes, and snippets.

@tekmaven
Last active April 30, 2016 18:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tekmaven/041a205276bf4d26e8f9 to your computer and use it in GitHub Desktop.
Save tekmaven/041a205276bf4d26e8f9 to your computer and use it in GitHub Desktop.
Install MongoDB on AppVeyor
#Make sure 7za is installed
choco install 7zip.commandline
# Create mongodb and data directory
md $env:temp\mongo\data
# Go to mongodb dir
Push-Location $env:temp\mongo
# Download zipped mongodb binaries to mongodbdir
Invoke-WebRequest https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.5.zip -OutFile mongodb.zip
# Extract mongodb zip
cmd /c 7za e mongodb.zip
# Install mongodb as a windows service
cmd /c $env:temp\mongo\mongod.exe --logpath=$env:temp\mongo\log --dbpath=$env:temp\mongo\data\ --smallfiles --install
# Sleep as a hack to fix an issue where the service sometimes does not finish installing quickly enough
Start-Sleep -Seconds 5
# Start mongodb service
net start mongodb
# Return to last location, to run the build
Pop-Location
Write-Host
Write-Host "monogdb installation complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment