Skip to content

J8k3/aws-ms-deploy-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS EC2 Deployment Assistant for Microsoft Developer Platforms

About This Repository

This project was originally developed by Jacob Marks, Official Website & Engineering Blog, during his early tenure at Amazon. This fork of the AWS Labs repository serves to maintain continuity of Jacob's code contributions and preserve the work for reference and ongoing development.

Overview

Deployment automation from Microsoft Developer platforms (Microsoft Visual Studio and/or Microsoft Team Foundation Server) to AWS EC2 instances is a common customer requirement. AWS Developer Tools can support the continuous delivery/continuous deployment requirements for AWS customers leveraging these development platforms at a very low cost while monitoring and maintaining application availability. This capability comes through the AWS CodePipeline and CodeDeploy services that can consume the precompiled output of the Microsoft Build System. To begin this pipeline, build output must be packaged and uploaded to an AWS S3 staging location where it is picked up by the AWS CodePipeline service and can then flow through a customer defined continuous delivery workflow.

CodePipeline Learn more >>

AWS CodePipeline is a continuous delivery service for fast and reliable application updates.

CodeDeploy Learn more >>

AWS CodeDeploy is a service that automates code deployments to any instance, including Amazon EC2 instances and instances running on-premises.

Why This Exists

Microsoft developers using Visual Studio and TFS were heavily pulled toward Azure because deployment workflows felt native there. AWS often required extra manual packaging, deployment scripting, and operational setup just to reach the same starting point.

AWS Deployment Assistant was built to reduce that friction by making AWS CodePipeline and CodeDeploy fit naturally into existing Visual Studio and TFS workflows.

Instead of changing how developers worked, the goal was to let standard post-build events and MSBuild targets trigger repeatable AWS deployments automatically.

This included:

  • Packaging build output
  • Generating deployment archives
  • AppSpec generation for CodeDeploy
  • Default deployment lifecycle scripts
  • S3 artifact delivery for CodePipeline
  • Credential profile management
  • Extensible plugin support for deployment customization

The goal was simple: make AWS feel like the easier choice for Microsoft platform teams.

The Tool

The AWS EC2 Deployment Assistant for Microsoft Developer Platforms is a utility application that enables integration of the AWS CodePipeline and CodeDeploy Services into the Visual Studio or Team Foundation Server build process. It handles the packaging and upload of successful builds to the AWS S3 service staging location where it is picked up by the AWS CodePipeline service and can then flow through a customer defined continuous delivery workflow.

Features

  • Build Output Preparation
    • Automates the packaging and preparation of build output
    • Extensible plugin framework enables custom task insertion (more info below)
  • Create Deployment Package
    • Creates zip format archive of build output
    • Filtered by include and exclude expression
  • Upload Package to S3 Drop Location
    • Package pushed to S3 drop location where CodePipeline can pickup and execution workflow
    • Uses stored credential profile
  • Stored Credential Profile Management
    • Enables command line management of stored credential profiles

How It Works

Using Visual Studio Post Build Events, MSBuild Events or a customized Team Foundation Server (TFS) Build Template, the AWS Deployment Assistant runs against a successful builds output.

Tool Execution Workflow

Tool Setup

Today, the AWS EC2 Deployment Assistant requires manually installation for use as part of a DevOps process. You do not need to download or build the projects code if you only wish to use the tool. To setup/install the tool please follow the steps below:

  1. Download the Latest Release distribution package.
  2. Create the following folder path "C:\Program Files (x86)\AWS Tools\EC2 Deployment Assistant".
  3. Unzip the distribution package directly to "C:\Program Files (x86)\AWS Tools\EC2 Deployment Assistant". Please make sure that distribution files are directly at the root of that path.
  4. Create the following folder paths "C:\temp\AWS Development Tools\EC2 Deployment Assistant\logs" and "C:\temp\AWS Development Tools\EC2 Deployment Assistant\temp".
  5. Configure your project(s) to invoke the continuous delivery pipeline after a successful build. A successful builds output can be hooked in several ways and you should pick the option that best matches your DevOps needs.
    • Visual Studio Project Post-Build Event Setup

      • This option triggers a pipeline on a successful build within Visual Studio. In this example, the build must be run with a build configuration called "Deploy".
      • To configure this option, edit the project properties for the project you wish to deploy. On the Build Events table paste the below snippet into the Post Build field. Be sure to update the bucket, profile and zipname attributes for your use case.

      "if $(ConfigurationName) == Deploy (
      "C:\Program Files (x86)\AWS SDK for .NET\bin\Developer Tools\AWSDeploymentAssistant.exe" build --source "$(ProjectDir)." --bucket "useast-my-bucket" --profile �default" --zipname "MyCodePackage.zip" )

      Post Build Event

    • TFS Build Template Setup

      • This option triggers a pipeline on a successful build within Team Foundation Server (TFS). Instructions Coming Soon!
    • Project File MSBuild Event Setup

      • This option triggers a pipeline on a successful build within Visual Studio or Team Foundation Server (TFS). In this example, the build must be run with a build configuration called "Deploy".
      • To configure this option, edit the project file for the project you wish to deploy. Find the commented line <Target Name="AfterBuild"></Target>, generally at the end of a project file, and uncomment. Between the opening and closing tags of this element add the below snippet. Be sure to update the bucket, profile and zipname attributes for your use case.

      <Exec Command=""C:\Program Files (x86)\AWS Tools\EC2 Deployment Assistant\AWSDeploymentAssistant.exe" build --source "$(MSBuildProjectDirectory)" --bucket "useast-my-bucket" --profile "default" --zipname "MyCodePackage.zip"" Condition="'$(Configuration)'=='Deploy'" />

      MSBuild Event

  6. Configure deployment content filter. When creating a deployment package, the tool filters the file contents that it packages using a configurable �include� and �exclude pattern�.
    • See "PublishFileTypesIncludePattern" for files/paths you wish to include in the AWSDeploymentAssistant.exe.config file.
    • See "PublishFileTypesExcludePattern" for files/paths you wish to exclude in the AWSDeploymentAssistant.exe.config file.

Configuring CodePipeline and CodeDeploy

To configure CodePipeline and CodeDeploy for this tool follow the following steps:

  1. Walk through the Simple Pipeline Walkthrough (Amazon S3 Bucket) >> documentation Steps one thru four.

Build Output Preparation Plugins

The AWS EC2 Deployment Assistant supports extensibility for the preparation of build output. At runtime, the tool loads plugins from the "C:\Program Files (x86)\AWS Tools\EC2 Deployment Assistant\plugins" directory. Plugins can do any number of things to prepare build output for deployment and run with a priority weighting. Plugins can accept input through options json files that include key value pair string values. Each plugin includes a name attribute set at implementation. Plugins are simply classes within an assembly placed in the plugin folder that Implement the IDeploymentTask interface. Options files are read from the root path of the build content being processed and file names must follow the format �<PluginName>.options.json�. The sample CodeDeploy plugin generates a CodeDeploy AppSpec file.

CodeDeploy Plugin

The CodeDeploy Plugin will automatically generate an AWS CodeDeploy service deployment definition, an AppSpec.yml file as well as PowerShell scripts to execute a simple deployment to an IIS root site. Options may be specified in a plugin options file "AWSCodeDeployPlugin.options.json" to customize deployment behavior. For more complex deployment requirements, we recommend that you include an AppSpec file and any required deployment scripts in your build output. If an AppSpec is already present, the AWS EC2 Deployment Assistant will skip auto generation.

Development Environment Setup

If you would like to develop additional functionality, such as a new plugin, you will need to follow the below steps to get up and running:

  1. Clone the "aws-ms-deploy-assistant" repository Clone >>.
  2. Either manually configure "Tool Setup" as described above, note that you must manually add file system ACLs to allow the copy of build output to the tool runtime path, or run the "Initialize-Environment.ps1" script included in the repository (Local Admin Rights Required). Be sure to replace the account name "<Domain\Account>" in the script with your account details before you run the script.
  3. Build your environment.

Debugging

To debug the AWS EC2 Deployment Assistant or any of its plugins, set the "AWSDeploymentAssistant" project as the startup project. Set the debug command line arguments for your environment and then run the solution in debug mode. Be sure to include a leading space in your command argument.

build --source "<source path for deploy content>"" --bucket "useast-my-bucket" --profile "default" --zipname "MyCodePackage.zip"

Command Line Args

Demo Website

The demo website is preconfigured using the "Project File MSBuild Event" method of invoking a deployment pipeline. Be sure to update the bucket, profile and zipname attributes for your use case.


Copyright 2016 - 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at https://github.com/awslabs/aws-ms-deploy-assistant/blob/master/LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors