Skip to content

Commit

Permalink
Merge pull request #3750 from ministryofjustice/csr/ami-build-abort-step
Browse files Browse the repository at this point in the history
updating the stop command to abort upon error
  • Loading branch information
haitchison authored Oct 20, 2023
2 parents 14b74c4 + e5b5a15 commit 83978be
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mainSteps:
InstanceId: "{{ InstanceId }}"
VolumeId: "{{ VolumeId }}"
description: "{{ SnapshotName }}"
onFailure: Abort

- name: getRootVolumeSpace
action: aws:runPowerShellScript
Expand All @@ -44,14 +45,14 @@ mainSteps:
- name: extendDiskStop
action: aws:runPowerShellScript
maxAttempts: 1
onFailure: Stop
inputs:
runCommand:
- |
if ($availablePercentage% -lt 50) {
Write-Output "Available disk space is less than 50%. Stopping doc execution."
Exit 1
}
onFailure: Abort

- name: stopDiscoveryAgent
action: aws:runPowerShellScript
Expand Down Expand Up @@ -84,7 +85,7 @@ mainSteps:
} else {
Write-Host "AWS Discovery Agent uninstallation may have failed."
}
onFailure: Stop
onFailure: Abort

- name: InstallFirefoxBrowser
action: aws:runPowerShellScript
Expand Down

0 comments on commit 83978be

Please sign in to comment.