Skip to content

Commit

Permalink
feat(utils): add ECS start/stop commands to dg (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Jun 17, 2024
1 parent cc48f9c commit 173ea97
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions _utils/_scripts/aws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
source $DGPATH/_scripts/functions.sh
env=$1
CLUSTER_NAME=$(pass dg/aws/${env}/cluster/name)
SERVICE_ARN="$(pass dg/aws/${env}/cluster/service)"

echo "AWS CLIing in ${env}"
while test "$2" != --; do
case $2 in
k | kill | stop)
echo "stopping ECS for ${env}"
echo
aws ecs update-service --cluster $CLUSTER_NAME --service $SERVICE_ARN --desired-count 0
break
;;
s | start)
aws ecs update-service --cluster $CLUSTER_NAME --service $SERVICE_ARN --desired-count 1
break
;;
esac
done
4 changes: 2 additions & 2 deletions _utils/dg
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ while test "$1" != --; do
open https://github.com/users/dgrebb/projects/12
break
;;
a | act)
/bin/bash $DGPATH/_scripts/act.sh $2 $3
a | aws)
/bin/bash $DGPATH/_scripts/aws.sh $2 $3
break
;;
tp | test-performance)
Expand Down

0 comments on commit 173ea97

Please sign in to comment.