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
// Scenario | |
We've got two Azure web sites (Staging and Production), each with their respective database and we want to deploy to both websites from the same Git repository using continuous deployment. We need to take advantage of config transforms to accommodate the differences between the two environments, such as connection strings, for example. | |
Continuous deployment is fairly straight-forward, as we can simply specify different branches for each enivronment. For example, using GitFlow, we can use the "develop" branch to deploy to our Acceptance or Staging environment and our "master" branch to deploy to our Production environment. This allows us to use Pull Requests as an approval workflow for automated contiuous deployment. | |
// Setup | |
1) To enable config transforms for a web application project, simply add a transform for each environment required, in this case "Staging": |
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
/* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string */ | |
var qs = function(obj, prefix){ | |
var str = []; | |
for (var p in obj) { | |
var k = prefix ? prefix + "[" + p + "]" : p, | |
v = obj[k]; | |
str.push(angular.isObject(v) ? qs(v, k) : (k) + "=" + encodeURIComponent(v)); | |
} | |
return str.join("&"); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- web.config contributed to html5boilerplate by Velir : velir.com --> | |
<configuration> | |
<system.webServer> | |
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024"> | |
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> | |
<staticTypes> | |
<add mimeType="text/*" enabled="true" /> | |
<add mimeType="message/*" enabled="true" /> | |
<add mimeType="application/javascript" enabled="true" /> |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] |