Skip to content

Instantly share code, notes, and snippets.

@JayBeavers
Last active August 29, 2015 14:07
Show Gist options
  • Save JayBeavers/6d758a3f76fe34cf5a32 to your computer and use it in GitHub Desktop.
Save JayBeavers/6d758a3f76fe34cf5a32 to your computer and use it in GitHub Desktop.
azure site tail log of a nodejs deployment with a custom build script in which 'node server.js' seems to be launched before the build process is called
info: Executing command site log tail
2014-10-13T21:21:37 Welcome, you are now connected to log-streaming service.
2014-10-13T21:21:38 Updating submodules.
2014-10-13T21:21:38 Preparing deployment for commit id 'a3c1ec6cd5'.
2014-10-13T21:21:38 Running custom deployment command...
2014-10-13T21:21:38 Running deployment command...
2014-10-13T21:21:38 Command: deploy.cmd
2014-10-13T21:21:39 Handling node.js deployment.
2014-10-13T21:21:39 KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
2014-10-13T21:21:39 Copying file: 'IISNode.yml'
2014-10-13T21:21:39 Copying file: 'webserver\app.6.js'
2014-10-13T21:21:39 Using start-up script server.js from package.json.
2014-10-13T21:21:39 Generated web.config.
2014-10-13T21:21:39 Node.js versions available on the platform are: 0.6.17, 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32.
2014-10-13T21:21:40 Selected node.js version 0.10.29. Use package.json file to choose a different version.
2014-10-13T21:21:40 Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
2014-10-13T21:21:40 Calling "D:\Program Files (x86)\nodejs\0.10.29\node.exe" "D:\Program Files (x86)\npm\1.4.10\node_modules\npm\bin\npm-cli.js" install --production
2014-10-13T21:21:49 Calling bower install
Mon, 13 Oct 2014 21:21:53 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at webserver\app.js:195:11
Mon, 13 Oct 2014 21:21:54 GMT body-parser deprecated undefined extended: provide extended option at node_modules\body-parser\index.js:75:29
Mon, 13 Oct 2014 21:21:54 GMT express-session deprecated undefined resave option; provide resave option at webserver\app.js:197:11
Mon, 13 Oct 2014 21:21:54 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at webserver\app.js:197:11
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Mon, 13 Oct 2014 21:21:59 GMT server Express server listening on port undefined
GET / 200 62.090 ms - 1601
GET /css/styles.css 200 20.195 ms - 18923
GET /partials/home.html 200 14.310 ms - 7572
2014-10-13T21:22:06 Calling grunt build
2014-10-13T21:22:12 >> Local Npm module "grunt-contrib-watch" not found. Is it installed?
2014-10-13T21:22:12 >> Local Npm module "grunt-express-server" not found. Is it installed?
2014-10-13T21:22:12
2014-10-13T21:22:12 Running "traceur:all" (traceur) task
2014-10-13T21:22:16 transpiling: webserver/app.js <- webserver/app.6.js
2014-10-13T21:22:16 transpiling: queueprocessor/queueClient.js <- queueprocessor/queueClient.6.js
2014-10-13T21:22:16 transpiling: webclient/js/app.js <- webclient/js/app.6.js
2014-10-13T21:22:16
2014-10-13T21:22:59 Running "jshint:files" (jshint) task
2014-10-13T21:22:59 >> 22 files lint free.
2014-10-13T21:22:59
2014-10-13T21:22:59 Done, without errors.
2014-10-13T21:22:59 Finished successfully.
2014-10-13T21:22:59 Deployment successful.
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.10
:: ----------------------
:: Prerequisites
:: -------------
:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
goto error
)
:: Setup
:: -----
setlocal enabledelayedexpansion
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 (
:: Install kudu sync
echo Installing Kudu Sync
call npm install kudusync -g --silent
IF !ERRORLEVEL! NEQ 0 goto error
:: Locally just running "kuduSync" would also work
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment
:: Utility Functions
:: -----------------
:SelectNodeVersion
IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
:: The following are done only on Windows Azure Websites environment
call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
IF !ERRORLEVEL! NEQ 0 goto error
IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
IF !ERRORLEVEL! NEQ 0 goto error
)
IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
IF !ERRORLEVEL! NEQ 0 goto error
)
IF NOT DEFINED NODE_EXE (
SET NODE_EXE=node
)
SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
SET NPM_CMD=npm
SET NODE_EXE=node
)
goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------
:Deployment
echo Handling node.js deployment.
:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Select node version
call :SelectNodeVersion
:: 3. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
echo Calling !NPM_CMD! install --production
pushd "%DEPLOYMENT_TARGET%"
call :ExecuteCmd !NPM_CMD! install --production
IF !ERRORLEVEL! NEQ 0 goto error
popd
)
:: 4. Install bower packages
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
pushd "%DEPLOYMENT_TARGET%"
rem echo Calling install bower
rem call :ExecuteCmd !NPM_CMD! install bower
rem IF !ERRORLEVEL! NEQ 0 goto error
echo Calling bower install
call :ExecuteCmd node_modules\.bin\bower install
IF !ERRORLEVEL! NEQ 0 goto error
popd
)
:: 5. Run Grunt
IF EXIST "%DEPLOYMENT_TARGET%\gruntfile.js" (
pushd "%DEPLOYMENT_TARGET%"
rem echo Installing grunt
rem call :ExecuteCmd !NPM_CMD! install grunt-cli
rem IF !ERRORLEVEL! NEQ 0 goto error
echo Calling grunt build
call :ExecuteCmd node_modules\.bin\grunt --no-color build
IF !ERRORLEVEL! NEQ 0 goto error
popd
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error
goto end
:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%
:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul
:exitSetErrorLevel
exit /b 1
:exitFromFunction
()
:end
endlocal
echo Finished successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment