In a deployment pipeline, automation lets you focus more on your application and worry less about the manual aspects of deployment or the steps required to get application code updated. This is in addition to enabling you to continuously integrate code changes and offer faster feedback to the developers.
In this blog post, we’ll show you how to use GitHub, Jenkins AWS Elastic Beanstalk Deployment plugin and AWS Elastic Beanstalk to create a deployment pipeline for Sitefinity that is updated automatically every time you change your code. For this, we assume you have working knowledge of Git and Amazon EC2.
Before we get started, let’s cover what Elastic Beanstalk and Jenkins are, and the roles they play.
Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go and Docker. Elastic Beanstalk enables you to focus on development instead of infrastructure, as it will automatically handle provisioning and operating the infrastructure required to get your apps up and running.
Jenkins is a popular continuous integration and continuous delivery tool. Jenkins can build and test your software projects continuously while offering various delivery options as well as a very extensible interface powered by Jenkins plugins.
For this demo, we are using the GitHub repository (this is where our Sitefinity sample application is stored), one dedicated Jenkins server (which is responsible for pulling our latest source code changes from GitHub), building our solution and preparing a package (which is deployed to AWS using Jenkins AWS Elastic Beanstalk deployment plugin).
First, we must prepare our local Sitefinity solution to be deployable in AWS. For that, we need to:
After that, we need to prepare our source code as package ZIP file, then we will upload this package for our initial deployment in AWS:
First, create a GitHub repo, commit and push your changes.
Once you’ve pushed your changes, your repository should look like this:
This environment is where the Jenkins AWS Elastic Beanstalk deployment plugin will deploy our code.
Create an Elastic Beanstalk application named SitefinityDemo. Next, create an Elastic Beanstalk environment named SitefinityDemo-env with the following parameters:
For Web Server Environment, choose Create Web Server.
For Predefined configuration, choose .NET (Windows/IIS).
For Source, choose Upload your code, then click Upload
Choose your ZIP file located in ~/obj/Debug/Package and click Upload.
Click Configure more options
Under Network section click Modify
Check all Instance subnets and, most importantly, check instance security group to match your RDS security group, as shown below:
Click Create Environment
Elastic Beanstalk will begin provisioning your environment as shown below:
After successfully creating our environment, there will be a URL on which our Sitefinity Web App will be available.
Click on the URL, and there is our Sitefinity hosted in AWS Elastic Beanstalk environment!
Once we’ve prepared our deployment environment, we need to set up our build environment. First install and set up Jenkins on an EC2 instance (https://github.com/laardee/jenkins-installation).
Once you have installed Jenkins, navigate to Manage Jenkins -> Manage Plugins and install the following plugin: AWS Elastic Beanstalk Deployment Plugin
Click New Item
Enter “SitefinityDemo” for the name and chose Freestyle project.
First check, GitHub project option.
Under the Source Code Management section:
Under Build Environment:
Under Build Sections:
The following argument is important: /t:package /p:DeployIisAppPath="Default Web Site". This will make sure that each time you commit your changes to source code, a new package will be created and then deployed to AWS using Elastic Beanstalk deployment plugin.
Click “Add build step” and choose “AWS Elastic Beanstalk”.
Root Object: “\obj\Debug\Package\SitefinityWebApp.zip”
Now, you have a continuous deployment that will automatically build and deploy to Elastic Beanstalk each time you check in code. We are curious to hear more about your deployment setup, so share your setup in the comments. Happy deploying!
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.