From 7bc0b195ea4bef7a215f1ec0f71e41fedc6f0e15 Mon Sep 17 00:00:00 2001 From: lukqw <39307517+lukqw@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:21:44 +0200 Subject: [PATCH] update README for upcoming release (#32) --- .github/workflows/ci.yml | 8 ++------ .github/workflows/ephemeral.yml | 2 +- README.md | 7 +++++-- action.yml | 4 +++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e45678..a70cfe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,5 @@ name: LocalStack Test on: - push: - paths-ignore: - - ./*.md - - LICENSE pull_request: paths-ignore: - ./*.md @@ -137,10 +133,10 @@ jobs: - name: Run AWS Commands run: | - awslocal s3 rb s3://test awslocal s3 mb s3://test - awslocal sqs delete-queue --queue-url $(awslocal sqs get-queue-url --queue-name test-queue --output text) + awslocal s3 rb s3://test awslocal sqs create-queue --queue-name test-queue + awslocal sqs delete-queue --queue-url $(awslocal sqs get-queue-url --queue-name test-queue --output text) - name: Save the State Artifact uses: jenseng/dynamic-uses@v1 diff --git a/.github/workflows/ephemeral.yml b/.github/workflows/ephemeral.yml index 5b85d35..d2ddff8 100644 --- a/.github/workflows/ephemeral.yml +++ b/.github/workflows/ephemeral.yml @@ -21,6 +21,7 @@ jobs: "skip-ephemeral-stop": "true", "preview-cmd": ${{ toJSON(env.PREVIEW_CMD) }}, "lifetime": 5, + "extension-auto-install": "localstack-extension-mailhog", } env: LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} @@ -29,7 +30,6 @@ jobs: awslocal s3 mb s3://test-bucket awslocal sqs create-queue --queue-name=test-queue echo "Deploy is done." - EXTENSION_AUTO_INSTALL: "localstack-extension-mailhog" - name: Assertion step run: | diff --git a/README.md b/README.md index 17fc5be..7899633 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A GitHub Action to setup [LocalStack](https://github.com/localstack/localstack) - Installing [LocalStack AWS CLI](https://github.com/localstack/awscli-local), a thin wrapper around the `aws` command line interface for use with LocalStack to run integration tests over AWS services. - Export/import [LocalStack state](https://docs.localstack.cloud/user-guide/state-management/export-import-state/) as an artifact - Save/load [LocalStack Cloud Pods](https://docs.localstack.cloud/user-guide/state-management/cloud-pods/) -- Start/stop a [LocalStack Ephemeral Instance](https://docs.localstack.cloud/user-guide/cloud-sandbox/application-previews/) _(EXPERIMENTAL)_ +- Start/stop a [LocalStack Ephemeral Instance](https://docs.localstack.cloud/user-guide/cloud-sandbox/ephemeral-instance/) _(PREVIEW)_ ## Usage @@ -76,7 +76,7 @@ If the key is not found LocalStack by default falls back to the CE edition and d > **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set to **save/load** LocalStack's state either as a Cloud Pod or as a file artifact. -### Manage App Preview (Ephemeral Instance) +### Manage Application Previews (on an Ephemeral Instance) ```yml uses: LocalStack/setup-localstack@$v0.2.0 with: @@ -106,12 +106,15 @@ with: | Input | Description | Default | | ------------------ | -------------------------------------------------------------------------------- | -------- | +| `auto-load-pod` | Which pod to load on startup of LocalStack (application preview) | `None` | | `ci-project` | Name of the CI project to track in LocalStack Cloud | | | `configuration` | Configuration variables to use while starting LocalStack container | `None` | +| `extension-auto-install` | Which extensions to install on startup of LocalStack (application preview) | `None` | | `github-token` | Github token used to create PR comments | | | `image-tag` | Tag of the LocalStack Docker image to use | `latest` | | `include-preview` | Whether to include the created Ephemeral Instance URL in the PR comment | `false` | | `install-awslocal` | Whether to install the `awslocal` CLI into the build environment | `true` | +| `lifetime` | How long an ephemeral instance should live | 30 | | `preview-cmd` | Command(s) used to create a Ephemeral Instance of the PR (can use `$AWS_ENDPOINT_URL`) | | | `skip-ephemeral-stop` | Skip stopping LocalStack Ephemeral Instance | `false` | | `skip-startup` | Explicitly prevent LocalStack start up, only installs CLI(s). Recommended to manage state later on in the pipeline or start up an ephemeral instance. | `false` | diff --git a/action.yml b/action.yml index 275757b..587adc5 100644 --- a/action.yml +++ b/action.yml @@ -133,7 +133,9 @@ runs: { "github-token": ${{ toJSON(inputs.github-token) }}, "preview-cmd": ${{ toJSON(inputs.preview-cmd) }}, - "auto-load-pod": ${{ toJSON(inputs.state-name) }} + "extension-auto-install": ${{ toJSON(inputs.extension-auto-install )}}, + "auto-load-pod": ${{ toJSON(inputs.auto-load-pod) }}, + "lifetime": ${{ toJSON(inputs.lifetime )}} } # Use different artifact from current workflow's by passing the workflow's id as WORKFLOW_ID env variable