0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/.github/actions/setup-localstack/action.yaml
peusebiu 0eb984426e
fix(nightly): create bucket for s3 testing with localstack (#1872)
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
2023-10-02 15:31:50 +03:00

35 lines
1.6 KiB
YAML

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==2.3.1 # 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.3.1 # 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 "Startup complete"
aws --endpoint-url=http://localhost:4566 s3api create-bucket --bucket zot-storage --region us-east-2 --create-bucket-configuration="{\"LocationConstraint\": \"us-east-2\"}"
env:
AWS_ACCESS_KEY_ID: fake
AWS_SECRET_ACCESS_KEY: fake