2023-09-28 13:59:52 -05:00
|
|
|
name: 'Setup localstack service'
|
|
|
|
description: 'Download & run localstack container'
|
2023-09-29 03:40:46 -05:00
|
|
|
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 }}
|
2023-09-28 13:59:52 -05:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2023-09-29 03:40:46 -05:00
|
|
|
- uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ inputs.username }}
|
|
|
|
password: ${{ inputs.password }}
|
2023-09-28 13:59:52 -05:00
|
|
|
- shell: bash
|
|
|
|
run: |
|
2023-09-29 13:32:27 -05:00
|
|
|
pip install localstack==2.3.1 # Install LocalStack cli
|
2023-09-29 03:40:46 -05:00
|
|
|
# Below image was copied manually from localstack/localstack:2.2 and uploaded to ghcr
|
2023-09-29 13:32:27 -05:00
|
|
|
docker pull ghcr.io/project-zot/ci-images/localstack:2.3.1 # Make sure to pull a working version of the image
|
2023-09-29 03:40:46 -05:00
|
|
|
localstack start -d # Start LocalStack in the background
|
2023-09-28 13:59:52 -05:00
|
|
|
|
2023-09-29 03:40:46 -05:00
|
|
|
echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container
|
|
|
|
localstack wait -t 30 # to become ready before timing out
|
2023-09-28 13:59:52 -05:00
|
|
|
echo "Startup complete"
|
|
|
|
|
2023-10-02 07:31:50 -05:00
|
|
|
aws --endpoint-url=http://localhost:4566 s3api create-bucket --bucket zot-storage --region us-east-2 --create-bucket-configuration="{\"LocationConstraint\": \"us-east-2\"}"
|
2023-09-28 13:59:52 -05:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: fake
|
|
|
|
AWS_SECRET_ACCESS_KEY: fake
|