@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off echo :: -------------------------------------- echo :: KUDU Jekyll Deployment Script echo :: Version: 1.0.3, February 2018 echo :: version 20180213 echo :: GK Jekyll echo :: -------------------------------------- echo :: . echo :: Prerequisites echo :: ------------- :: Verify node.js installed where node 2>nul >nul IF %ERRORLEVEL% NEQ 0 ( echo Missing node.js executable, please install node.js. goto error ) echo :: Setup echo :: ----- setlocal enabledelayedexpansion SET LC_ALL="en_US.UTF-8" SET LANG="en_US.UTF-8" SET ARTIFACTS=%~dp0%..\artifacts IF NOT DEFINED DEPLOYMENT_SOURCE ( SET DEPLOYMENT_SOURCE=%~dp0%. ) IF NOT DEFINED DEPLOYMENT_TARGET ( SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot ) IF NOT DEFINED NEXT_MANIFEST_PATH ( SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest ) IF NOT DEFINED PREVIOUS_MANIFEST_PATH ( SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest ) IF NOT DEFINED KUDU_SYNC_CMD ( echo :: Install kudu sync call npm install kudusync -g --silent IF !ERRORLEVEL! NEQ 0 goto error echo :: Locally just running "kuduSync" would also work SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd ) echo :: . echo :: Prepare Ruby and Jekyll echo :: ------------------------ echo :: . echo :: Put Ruby in Path SET PATH=%PATH%;%ARTIFACTS%\ruby\ruby-2.3.3-x64-mingw32\bin;%ARTIFACTS%\ruby-devkit\bin;%DEPLOYMENT_SOURCE%\_azurebin echo :: . echo :: Check Ruby Prerequisites echo :: . IF EXIST %ARTIFACTS%\RUBYV20180119 goto rubyinstalled echo :: Installing Jekyll Rerequirements echo :: May take a lot of time echo :: . mkdir %ARTIFACTS% 2>nul >nul cd %ARTIFACTS% echo :: Clean Artifacts rm -rf ruby rm -rf rubydevkit echo :: Download Dependencies curl -L -o Ruby.zip https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z?direct curl -L -o RubyDevKit.zip https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe?direct echo :: START Unzipping Ruby and DevKit d:\7zip\7za x Ruby.zip -oruby d:\7zip\7za x RubyDevKit.zip -orubydevkit echo :: DONE Unzipping Ruby and DevKit echo :: Cleanup rm Ruby.zip rm RubyDevKit.zip echo :: Init DevKit ruby rubydevkit\dk.rb init echo :: Tell DevKit where Ruby is echo - %ARTIFACTS%\ruby\ruby-2.3.3-x64-mingw32 >> config.yml echo :: Setup DevKit ruby rubydevkit\dk.rb install echo :: Change Path to Repository cd %DEPLOYMENT_SOURCE% echo :: Call Installer (takes its time) call gem install bundler -V echo :: Ruby Environment installed. echo ruby-installed > %ARTIFACTS%\RUBYV20180119 :rubyinstalled ruby -v echo :: . echo :: Check Jekyll Prerequisites echo :: . IF EXIST %ARTIFACTS%\JEKYLL20180204 goto jekyllinstalled echo :: . echo :: Bundler Jobs echo :: . ::echo :: Running bundle clean ::bundle clean --force echo :: Running bundle install call bundle install ::echo :: Running bundle package ::bundle package --all echo :: Install Jekyll call gem update jekyll echo jekyll-installed > %ARTIFACTS%\JEKYLL20180204 :jekyllinstalled echo :: Running bundle update call bundle update echo :: . echo :: . echo :: Jekyll Deployment echo :: . call bundle exec jekyll -v call bundle exec jekyll b echo :: . echo :: . echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: echo :: Kudu Deployment echo :: ---------------- echo :: . echo :: Handling Basic Web Site deployment. echo :: . echo :: KuduSync call "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%/_site" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd;Gemfile;Gemfile.lock;README.MD" echo :: . echo :: KuduSync finished echo :: . endlocal echo :: Finished successfully.