Skip to content

Commit 3b9e6cc

Browse files
authored
add new cloud pods action (#7)
1 parent a81707a commit 3b9e6cc

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,30 @@ jobs:
2323
awslocal s3 mb s3://test
2424
awslocal s3 ls
2525
echo "Test Execution complete!"
26+
27+
cloud-pods-test:
28+
name: 'Test Cloud Pods Action'
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: ⚡️ Checkout the repository
32+
uses: actions/checkout@v3
33+
34+
- name: Start LocalStack
35+
uses: ./
36+
with:
37+
image-tag: 'latest'
38+
install-awslocal: 'true'
39+
use-pro: 'true'
40+
env:
41+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
42+
43+
- name: Run AWS commands
44+
run: |
45+
awslocal s3 mb s3://test
46+
awslocal sqs create-queue --queue-name test-queue
47+
48+
- name: Save the Cloud Pod
49+
uses: LocalStack/setup-localstack/cloud-pods@main
50+
with:
51+
name: cloud-pods-test
52+
action: save

cloud-pods/action.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Save/Load a LocalStack Cloud Pod'
2+
3+
inputs:
4+
name:
5+
description: 'Name of the Cloud Pod'
6+
required: true
7+
default: 'cloud-pod'
8+
action:
9+
description: 'Action to perform (save or load)'
10+
required: true
11+
default: 'save'
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
-
17+
run: |
18+
if [ "$ACTION" = "save" ]; then
19+
echo "Saving Cloud Pod $NAME"
20+
localstack pod save $NAME
21+
elif [ "$ACTION" = "load" ]; then
22+
echo "Loading Cloud Pod $NAME"
23+
localstack pod load $NAME
24+
else
25+
echo "Invalid action: $ACTION"
26+
exit 1
27+
fi
28+
shell: bash
29+
env:
30+
NAME: "${{ inputs.name }}"
31+
ACTION: "${{ inputs.action }}"

0 commit comments

Comments
 (0)