The following values need to be replaced with your relevant Amazon S3 settings.

MYBUCKETNAME
MYAWSACCESSKEY
MYAWSSECRETKEY

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
  <UsingTask
      TaskName="CDNSync.MSBuild.SyncTask"
      AssemblyFile="CDNSync.dll" />

  <Target Name="AfterBuild">
    <!--
            ItemGroup\Files collection of files to be uploaded
            ItemGroup\Folders collection of folders to be uploaded. Used in conjunction with the Recursive option
            ItemGroup\GZipExtensions collection of file extensions to be compressed when uploading
            BucketName: The Bucket name within the CDN Provider
            Provider: The CDN Provider. Amazon | 
            BucketRegion: Where the bucket is located. USEastCoast | USWestCoast | Singapore | Europe
            ProviderUserName: The CDN Providers UserName or AccessKey 
            ProviderPassword: The CDN Providers Password or Secret Key
            UseFolderNameInKey: [Optional] Set this to true if you want to derive the Key from the files immediate folder e.g BucketName/Content/Site.css
            Recursive: True | False When True will recurse all Sub-Directories and upload all files
            FileNamePrefix: [Optional] The filename will be prefixed with this value when uploaded e.g. 1.0_Site.css where 1.0_ is the FilePreix
            FileNameSuffix: [Optional] This filename will be suffixed with this value when uploaded e.g. Site_1.0.css where _1.0 is the FileSuffix 
        -->
    <ItemGroup>
      
      <Files Include="../Scripts/jquery-1.4.1.min.js"/>
      <Files Include="../Scripts/jquery.validate.min.js"/>

      <Folders Include="../Content/"/>
       
      <GZipExtensions Include=".css" />

    </ItemGroup>
    <SyncTask
        BucketName="MYBUCKETNAME"
        Provider="Amazon"
        BucketRegion="USEastCoast"
        ProviderUserName="MYAWSACCESSKEY"
        ProviderPassword="MYAWSSECRETKEY"
        Files="@(Files)"
        UseFolderNameInKey="True"
        Recursive="True"
        Folders="@(Folders)"
        GZipExtensions="@(GZipExtensions)"
            />
  </Target>
</Project>

Last edited Jun 26, 2010 at 2:53 AM by willbt, version 2

Comments

No comments yet.