4 - IIS Workflows and Pipelines
Once you have the Harness Services for IIS website, application, and virtual directory, and the Harness Environment for your target infrastructure, you create Harness Workflows to deploy the IIS website, application, and virtual directory Services.
In this topic we walk through create a Workflow for the IIS website Service, but the Workflows for IIS application and virtual directory Services follow the same steps:
- Create an IIS Website Workflow
- Deploy IIS Website
- Create an IIS Application and Virtual Directory Workflows
- Deploy IIS Pipeline
- Next Step
Create an IIS Website Workflow
Workflows are the deployment steps for services and environments, including types such as Canary and Blue/Green. Workflows also include verification, rollback, and notification steps.
- In your application, click Workflows.
- Click Add Workflow. The Workflow dialog appears.
The dialog has the following fields.
Give your Workflow a name and description that tells users what it is deploying.
In this guide, we will do a simple Basic workflow. For a summary of workflow types, see Add a Workflow.
Select the environment you added.
Select your IIS Website service.
Select the Infrastructure Definition you added.
When you are finished, click SUBMIT. The workflow is generated:
- Under Prepare Infra, click Select Nodes. The Node Select dialog appears.
If you deploy in multiple phases, you can control what hosts to use for each phase. If you are simply doing one phase, you do not need to select hosts.
The Node Select dialog has the following fields.
When you finished, click SUBMIT.
Select Specific hosts?
Select Yes to enter the hostname(s) of the nodes where you want the website deployed.
Select No to have Harness select the host(s) in the Infrastructure Definition based on the setup the in Environment. For AWS deployments, Tags are often used to help Harness select hosts.
Enter the number of instances you want deployed.
You can also enter a variable expression in this setting, such as a Workflow variable:
This turns the setting into a deployment parameter. When the Workflow is deployed (manually or by Trigger) you can provide a value for the parameter.
Instance Unit Type
Identify if the number in Instances is a count or percentage.
For example, if you select 10 in Instances, you can select Count and the artifact is deployed to 10 instances. Or you can enter 100 in Instances and select Percent and the artifact is deployed to 100% of the instances in the Infrastructure Definition.
- Under Deploy Service, click Install. The Install dialog appears.You can set how long the installation may take before it's timed out. The default is 60000ms or 10 minutes. When you are finished, click SUBMIT.
Now that your workflow is complete, you are ready to deploy.
Deploy IIS Website
Now you can deploy your workflow, observe the deployment steps in real-time, and confirm in your VPC.
- In your workflow, click Deploy.The Start New Deployment dialog appears.Here you simply select the artifact build and version to be deployed.
- In Artifacts, click the dropdown menu and select the artifact build and version to deploy. The list is generated automatically by Harness from the artifact source you specified when you set up your service.
You can also elect to skip any instances that already have the artifact build and version.
- Click SUBMIT to deploy. Harness shows the deployment in real-time:
Each workflow step is displayed. Click through each deployment step to see the logs and details.
Confirm Deployment in your Windows Instance
Now that the deployment was successful, confirm the website was added to the Windows instance(s):
- In your workflow Deployment page, click the Install step.
- Expand the Create Website section.
- In the log, note the location where the website was created:
INFO 2018-08-27 15:34:43 IIS-website 2 Started C:\Artifacts\IIS-website\relea http :8080:*
- Connect to your Windows instance via Microsoft Remote Desktop or other console.
- On the Windows instance, navigate to the location Harness reported to confirm the website was created:
Create an IIS Application and Virtual Directory Workflows
The steps for creating Workflows for IIS Applications and Virtual Directories are the same as the steps for creating a Workflow for an IIS Website, described above.
- Use the Harness Services you created for the IIS Application and Virtual Directory.
- Use the same Harness Environment and Infrastructure Definition you used to create the IIS Website Workflow.
- Deploy the IIS Virtual Directory Workflow first, then the IIS Application Workflow, and lastly the IIS Website Workflow. This sequence is best performed using a Harness Pipeline, described below.
Deploy IIS Pipeline
Once you have workflows for your IIS website, application, and virtual directory set up, you can create a Harness pipeline that deploys them in the correct order. For IIS, you must deploy them in the order website, application, and then virtual directory.
In you Harness application, click Pipelines. Follow the steps in Add a Pipeline to add a stage for each of your workflows.
When you are done, the pipeline will look like this:
Click Deploy. The Start New Deployment dialog opens. Select each workflow artifact. When you are done, the dialog will look like this:
Click SUBMIT. Here's what the pipeline looks in the deployment dashboard. You can see each Stage was successful: