ci(localstack): pin localstack python package to 2.2.0 and pull container image from ghcr (#1867)

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2023-09-29 11:40:46 +03:00
committed by GitHub
parent 3a9a932791
commit 0ec6f8acf8
3 changed files with 37 additions and 9 deletions
+21 -5
View File
@@ -1,16 +1,32 @@
name: 'Setup localstack service'
description: 'Download & run localstack container'
inputs:
# inputs for https://github.com/docker/login-action
username:
description: 'Username used to log against the github registry'
required: false
default: ${{ github.actor }}
password:
description: 'Password or personal access token used to log against the github registry'
required: false
default: ${{ github.token }}
runs:
using: "composite"
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.username }}
password: ${{ inputs.password }}
- shell: bash
run: |
pip install localstack # Install LocalStack cli
docker pull localstack/localstack:2.2 # Make sure to pull the latest version of the image
localstack start -d # Start LocalStack in the background
pip install localstack==2.2.0 # Install LocalStack cli
# Below image was copied manually from localstack/localstack:2.2 and uploaded to ghcr
docker pull ghcr.io/project-zot/ci-images/localstack:2.2 # Make sure to pull a working version of the image
localstack start -d # Start LocalStack in the background
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
localstack wait -t 30 # to become ready before timing out
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
localstack wait -t 30 # to become ready before timing out
echo "Startup complete"
aws dynamodb --endpoint-url http://localhost:4566 --region "us-east-2" create-table --table-name BlobTable --attribute-definitions AttributeName=Digest,AttributeType=S --key-schema AttributeName=Digest,KeyType=HASH --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5