Table of Contents |
---|
Objective
You have a shell script in a Git repository. The goal of the this tutorial is to execute a shell script on an AWS instance through FlexDeploy using the AWS Plugin. For this tutorial, we will be setting up an automated execution of the shell script .This process will which is present in a Git repository. The steps include:
Copy Copying the shell script from a Git repository
Execute Executing the shell script
We will walk through each of the FlexDeploy features that will be created/configured to accomplish this goal and Execute execute the shell script.
Checklist
Checklist | Description |
---|---|
AWS Access Key | AWS Access Key ID of IAM user |
AWS Secret Key | Password for the Access Key |
AWS CLI installation | AWS CLI needs to be installed on the Target m/c where the plugin operation shall run |
AWS CLI in class path | AWS CLI should be added to the classpath in target m/c. Else the path can also be set under FlexDeploy environment level property |
AWS PowerShell | AWS PowerShell needs to be installed on Windows OS and path should be added to the classpath in target m/c. Please refer to https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up-windows.html |
Configure cloud account
First, AWSaccount needs to be configured under Topology. FlexDeploy will connect to the AWS cloud and execute the script
...
AWS Access Key is a password field and hence needs to be kept hidden. To update the same click on the pencil icon as shown below
next update the AWS Access Key value under Secret Text. This is to make sure no one else can retrieve the password
...
Git
...
Repository Structure
The Git repository should contain shell script to execute.
...
Build Workflow
Navigate to the Workflows tab and create a workflow using the “+”(Click to create new Workflow) button as highlighted below.
...
Next, create one Build workflow as shown below. The workflow Type field defines the type of workflow.
Build Workflow
Navigate to the Workflows Tab
Select the “+” button from the left-hand pane to create a new workflow with type as Build.
...
The Workflow Group and Subgroup define the folder hierarchy. Once both workflows are created it should look like the below. No constraint on workflow or folder naming convention.
...
The steps of the workflow execution can be configured through the Workflow Definition section.
...
Below given is a sample build workflow to copy and execute the script.
...
The below step will copy the script file to the artifacts directory.
...
Step-iii : execute the script file
Code Snippet field is mandatory, we can select the type of CLI from the drop-down. Available options are shell, PowerShell, and WindowsShell. The default CLI type is the shell.
...
Project
...
Configuration
Navigate to the Project tab and create a Project with a logical name(AWS-Command in this case)
...
Navigate to the Topology from the Menu. The Page with the Target Groups, Environments and Endpoints sections will be displayed. Choose a Target Group on the left. You will see a list of Environments on the right with colored circles representing each Target.
...
Properties | Mandatory field | Description |
AWS ACCOUNT | Optional | AWS cloud account name |
AWS CLI | Optional | Directory Where AWS CLI is installed |
GIT Path | Optional | Path to the Git executable. Required only if git is not on PATH. |
Build Execution
For detailed steps on how to initiate Build please refer to Build execution through FlexDeploy for Azure Plugin
...