Skip to content

Instantly share code, notes, and snippets.

View sirkirby's full-sized avatar
:octocat:

Chris Kirby sirkirby

:octocat:
View GitHub Profile
@sirkirby
sirkirby / ang-pkg.json
Last active August 29, 2015 13:56
Automate nuget with grunt Ex 1
{
"name": "typeaheadjs-nuget",
"version": "0.10.1",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-shell": "~0.6.4",
"grunt-nuget": "~0.1.1"
}
}
@sirkirby
sirkirby / ang-grunt.js
Last active August 29, 2015 13:56
Automate nuget with grunt Ex 2
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["dist"],
shell: {
makeDir: {
command: 'mkdir dist'
}
},
@sirkirby
sirkirby / gen-deployscript.cmd
Last active August 29, 2015 13:56
Generate an azure deployment script for asp.net and node.js web applications using the azure cli tools
:: for my asp.net web application with nuget package restore in the src directory
azure site deploymentscript --aspWAP src/MyAspNetWebApp/MyAspNetWebApp.csproj -s src/MySolution.sln
:: for a node.js web application in the src directory
azure site deploymentscript --node --sitePath src
@sirkirby
sirkirby / aspnet-deployscript.cmd
Last active August 29, 2015 13:56
asp.net deployment script exerpt
:: 1. Restore NuGet packages
IF /I "src\MySolution.sln" NEQ "" (
call :ExecuteCmd "%NUGET_EXE%" restore "%DEPLOYMENT_SOURCE%\src\MySolution.sln"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\src\MyAspNetWebApp\MyAspNetWebApp.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
) ELSE (
:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\src" -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
:: 1. Restore NuGet packages
IF /I "src\MySolution.sln" NEQ "" (
call :ExecuteCmd "%DEPLOYMENT_SOURCE%\tools\nuget\nuget.exe" restore "%DEPLOYMENT_SOURCE%\src\MySolution.sln" -ConfigFile "%DEPLOYMENT_SOURCE%\tools\nuget\nuget.config"
IF !ERRORLEVEL! NEQ 0 goto error
)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="MyPrivateFeed" value="https://www.myget.org/F/privatefeed/" />
<add key="Official" value="http://nuget.org/api/v2/" />
</packageSources>
<packageSourceCredentials>
<MyPrivateFeed>
<add key="Username" value="readonlyuser" />
@sirkirby
sirkirby / debugoff-web.xml
Last active August 29, 2015 13:56
turn debug off to get bundling and minification in release mode locally
<!-- bundling and minification will only kick off when debug='false' is set. this tells the runtime that you're in a release environment -->
<compilation debug="false" targetFramework="4.5" />
@sirkirby
sirkirby / hipchat-api-post.js
Last active August 29, 2015 14:01
Azure mobile service custom api post kudu payload to hipchat
exports.post = function(request, response) {
console.log(request.body); // for debugging
var hipchat = require('node-hipchat');
var hipClient = new hipchat('myV1APIKey');
var color = "green"; // default to success color
var message = "Kudu deployment to <strong>" + request.body.siteName + "</strong> (" + request.body.deployer + ") triggered by <strong>" + request.body.author + "</strong>";
if (request.body.status === "success") {
message += " was successful!";
@sirkirby
sirkirby / kudu-postdeployment.json
Last active August 29, 2015 14:01
Kudu PostDeployment event payload
{
"id": "005c554bbeeaac0000000000000000000000",
"status": "success",
"statusText": "",
"authorEmail": "sirkirby@gmail.com",
"author": "Chris Kirby",
"message": "my last commit message",
"progress": "",
"deployer": "who triggered the deployment",
"receivedTime": "2014-05-12T23:45:17.4767323Z",