Skip to content

Commit f130510

Browse files
committed
testing
1 parent 5d44301 commit f130510

File tree

2 files changed

+102
-10
lines changed

2 files changed

+102
-10
lines changed

.github/workflows/cloudpod_release.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,45 @@ on:
44
release_tag:
55
type: string
66
required: true
7+
database_type:
8+
type: string
9+
required: true
10+
push:
11+
paths-ignore:
12+
- 'README.md'
13+
branches:
14+
- main
15+
- cloudpod_workflow
716

817
name: Create Release
918
jobs:
1019
build:
11-
uses: ./.github/workflows/main.yml
20+
uses: ./.github/workflows/setup.yml
1221
secrets: inherit
22+
with:
23+
store-cloudpod: "true"
24+
database-type: ${{ inputs.database_type || 'mysql' }}
25+
localstack-version: ${{ inputs.release_tag || 'latest'}}
1326
upload:
1427
name: Upload Release Asset
1528
runs-on: ubuntu-latest
1629
steps:
17-
- name: Save the Cloud Pod
18-
uses: HarshCasper/cloud-pod-save-action@0.1.0
30+
- name: Download Artifact
31+
uses: actions/download-artifact@v3
1932
with:
20-
name: 'release-pod.zip'
21-
location: 'disk'
22-
directory: '.'
33+
name: cloudpod
34+
- name: Display structure of downloaded files
35+
run: ls -R
2336
- name: Build project # This would actually build your project, using zip for an example artifact
2437
run: |
25-
echo "Cloudpod Release Version ${{ inputs.release_tag }}" > Release.txt
38+
echo "Cloudpod Release Version ${{ inputs.release_tag || 'latest'}}" > Release.txt
2639
- name: Create Release
2740
id: create_release
2841
uses: softprops/action-gh-release@v1
2942
with:
30-
tag_name: "v-${{ inputs.release_tag }}"
31-
name: "Cloudpod for LocalStack release ${{ inputs.release_tag }}"
32-
body: "Test Release ${{ inputs.release_tag }}"
43+
tag_name: "v-${{ inputs.release_tag || 'latest'}}"
44+
name: "Cloudpod for LocalStack release ${{ inputs.release_tag || 'latest'}}"
45+
body: "Test Release ${{ inputs.release_tag || 'latest'}} for database ${{ inputs.database_type || 'mysql' }}"
3346
files: |
3447
./release-pod.zip
3548
Release.txt

.github/workflows/setup.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Setup LocalStack
2+
on:
3+
workflow_call:
4+
inputs:
5+
store-cloudpod:
6+
required: true
7+
type: string
8+
database-type:
9+
required: true
10+
type: string
11+
localstack-version:
12+
required: true
13+
type: string
14+
15+
jobs:
16+
setup-localstack:
17+
name: Setup infrastructure
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.9'
27+
28+
- name: Setup Nodejs
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 16
32+
33+
- name: Install dependencies
34+
run: |
35+
make install
36+
37+
- name: Start LocalStack
38+
env:
39+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
40+
LOCALSTACK_VOLUME_DIR: ${{ github.workspace }}/ls_test
41+
MYSQL_FEATURE_FLAG: ${{ inputs.database-type }}
42+
run: |
43+
mkdir ls_test
44+
ls -la ls_test
45+
docker pull localstack/localstack-pro:${{ inputs.localstack-version }}
46+
# Start LocalStack in the background
47+
if [ "mysql" == ${MYSQL_FEATURE_FLAG} ]; then
48+
LS_LOG=trace RDS_MYSQL_DOCKER=1 localstack start -d
49+
else
50+
LS_LOG=trace localstack start -d
51+
fi
52+
# Wait 30 seconds for the LocalStack container to become ready before timing out
53+
echo "Waiting for LocalStack startup..."
54+
localstack wait -t 15
55+
echo "Startup complete"
56+
57+
- name: Deploy the application
58+
env:
59+
AWS_ACCESS_KEY_ID: test
60+
AWS_SECRET_ACCESS_KEY: test
61+
AWS_DEFAULT_REGION: us-east-1
62+
run: |
63+
make build
64+
make bootstrap
65+
make deploy
66+
67+
- name: Store Pod
68+
if: ${{ inputs.store-cloudpod == 'true' }}
69+
run: |
70+
localstack pod save file://pod.zip
71+
- name: Upload Pod as Artifact
72+
if: ${{ inputs.store-cloudpod == 'true' }}
73+
uses: actions/upload-artifact@v3
74+
with:
75+
name: cloudpod
76+
path: release-pod.zip
77+
retention-days: 1
78+
79+

0 commit comments

Comments
 (0)