Skip to content

Commit ffcdbea

Browse files
author
andrew
committed
merge
1 parent ba2a8cd commit ffcdbea

File tree

4 files changed

+71
-34
lines changed

4 files changed

+71
-34
lines changed

aliases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ alias debug='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma debug'
9292
alias deployment='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma deployment'
9393
alias deployment-delete-danger='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma deployment-delete-danger'
9494
alias deployment-groups='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma deployment-groups'
95+
alias deployments='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma deployments'
9596
alias deployments-group='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma deployments-group'
9697
alias distributions='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma distributions'
9798
alias ecr-repositories='${BMA_HOME:-$HOME/.bash-my-aws}/bin/bma ecr-repositories'

docs/command-reference.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,9 +1361,34 @@ List logging status of Cloudtrails
13611361
List deployments
13621362

13631363

1364+
### deployments
1365+
1366+
List all deployment IDs for a deployment group (not useful for the user, only internal)
1367+
# ?? if no deployment group, could we list all deployments for this application, with their groups and statuses?
1368+
1369+
13641370
### deployment-groups
13651371

1366-
List min, desired and maximum capacities of EC2 Autoscaling Group(s)
1372+
List all deployment groups for an application
1373+
1374+
1375+
## codedeploy-commands.bak
1376+
1377+
1378+
### deployment
1379+
1380+
List deployments
1381+
1382+
1383+
### deployments
1384+
1385+
List all deployment IDs for a deployment group (not useful for the user, only internal)
1386+
# ?? if no deployment group, could we list all deployments for this application, with their groups and statuses?
1387+
1388+
1389+
### deployment-groups
1390+
1391+
List all deployment groups for an application
13671392

13681393

13691394
## ecr-commands
@@ -2092,24 +2117,24 @@ Run a command locally on EC2 instance(s) running Windows
20922117
$ ssm-instances Windows | ssm-send-command-windows Get-Hotfix
20932118
Command ID: a0eeeddc-2edf-42bc-b0c7-122f5bc50956
20942119
Waiting for command to complete...
2095-
i-0fake1234abcd
2096-
Source Description HotFixID InstalledBy InstalledOn
2097-
------ ----------- -------- ----------- -----------
2098-
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2099-
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2100-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2101-
FAKEAPP01234 Update KB2345678 NT AUTHORITY\SYSTEM 1/9/2019 12:00:00 AM
2102-
FAKEAPP01234 Update KB3456789 NT AUTHORITY\SYSTEM 3/11/2021 12:00:00 AM
2103-
FAKEAPP01234 Security Update KB4567890 NT AUTHORITY\SYSTEM 4/21/2019 12:00:00 AM
2104-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 5/15/2019 12:00:00 AM
2105-
FAKEAPP01234 Security Update KB6789012 NT AUTHORITY\SYSTEM 6/12/2019 12:00:00 AM
2106-
---Output truncated---
2107-
i-0fake1234abcd
2108-
Source Description HotFixID InstalledBy InstalledOn
2109-
------ ----------- -------- ----------- -----------
2110-
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2111-
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2112-
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2120+
i-0fake1234abcd
2121+
Source Description HotFixID InstalledBy InstalledOn
2122+
------ ----------- -------- ----------- -----------
2123+
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2124+
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2125+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2126+
FAKEAPP01234 Update KB2345678 NT AUTHORITY\SYSTEM 1/9/2019 12:00:00 AM
2127+
FAKEAPP01234 Update KB3456789 NT AUTHORITY\SYSTEM 3/11/2021 12:00:00 AM
2128+
FAKEAPP01234 Security Update KB4567890 NT AUTHORITY\SYSTEM 4/21/2019 12:00:00 AM
2129+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 5/15/2019 12:00:00 AM
2130+
FAKEAPP01234 Security Update KB6789012 NT AUTHORITY\SYSTEM 6/12/2019 12:00:00 AM
2131+
---Output truncated---
2132+
i-0fake1234abcd
2133+
Source Description HotFixID InstalledBy InstalledOn
2134+
------ ----------- -------- ----------- -----------
2135+
FAKEAPP01234 Update KB1234567 NT AUTHORITY\SYSTEM 10/11/2023 12:00:00 AM
2136+
FAKEAPP01234 Update KB8901234 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
2137+
FAKEAPP01234 Security Update KB5678901 NT AUTHORITY\SYSTEM 12/12/2018 12:00:00 AM
21132138

21142139
See also: ssm-send-command-windows
21152140

functions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ debug
9292
deployment
9393
deployment-delete-danger
9494
deployment-groups
95+
deployments
9596
deployments-group
9697
distributions
9798
ecr-repositories

lib/codedeploy-functions

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ deployment() {
1313

1414
# aws deploy list-applications
1515
# aws deploy list-deployment-groups --application-name 'tenders-web-dev2'
16-
# list-deployments (limit to last 24 hours or most recent 5??)
16+
# list-deployments (limit to last 24 hours or most recent 5??) :
1717
# aws deploy list-deployments --deployment-group-name gc3-test2 --application-name grants-web-gc3-test2 --include-only-statuses "Succeeded" --query 'deployments[0]'
18-
# aws deploy get-deployment --deployment-id d-MLWOBA1PK
18+
# describe-deployment : aws deploy get-deployment --deployment-id d-MLWOBA1PK
19+
## deployment-status should return the status of the last deployment to this group
20+
# deployment-status : aws deploy get-deployment --deployment-id d-49ASRV1VL --query 'deploymentInfo.status'
1921
aws deploy list-deployments \
2022
${asg_names/#/'--auto-scaling-group-names '} \
2123
--output text \
@@ -31,24 +33,32 @@ deployment() {
3133
}
3234

3335

34-
deployment-groups() {
35-
36-
# List min, desired and maximum capacities of EC2 Autoscaling Group(s)
36+
deployments() {
3737

38-
local asg_names=$(skim-stdin "$@")
39-
[[ -z $asg_names ]] && __bma_usage "asg_name [asg_name]" && return 1
38+
# List all deployment IDs for a deployment group (not useful for the user, only internal)
39+
## ?? if no deployment group, could we list all deployments for this application, with their groups and statuses?
40+
local application_name=$(skim-stdin "$@")
41+
local deployment_group_name=$(skim-stdin "$@")
42+
[[ -z $application_name ]] && __bma_usage "application_name [application_name]" && return 1
4043

4144
# shellcheck disable=SC2086
42-
aws autoscaling describe-auto-scaling-groups \
43-
--auto-scaling-group-names $asg_names \
45+
aws deploy list-deployments \
46+
--application-name $application_name \
47+
--deployment-group-name $deployment_group_name \
4448
--output text \
45-
--query "AutoScalingGroups[][
46-
AutoScalingGroupName,
47-
MinSize,
48-
DesiredCapacity,
49-
MaxSize
50-
]" |
5149
column -s$'\t' -t
5250
}
5351

52+
deployment-groups() {
53+
54+
# List all deployment groups for an application
5455

56+
local application_name=$(skim-stdin "$@")
57+
[[ -z $application_name ]] && __bma_usage "application_name [application_name]" && return 1
58+
59+
# shellcheck disable=SC2086
60+
aws deploy list-deployment-groups \
61+
--application-name $application_name \
62+
--output text \
63+
--query "deploymentGroups[*]"
64+
}

0 commit comments

Comments
 (0)