-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: 'Start up Localstack' | ||
|
||
inputs: | ||
image-tag: | ||
description: 'Tag of the LocalStack Docker image to use' | ||
required: true | ||
default: 'latest' | ||
install-awslocal: | ||
description: 'Whether to install the `awslocal` CLI into the environment' | ||
required: true | ||
default: 'true' | ||
use-pro: | ||
description: 'Whether to use LocalStack Pro (requires a valid API key)' | ||
required: false | ||
default: 'false' | ||
configuration: | ||
description: 'Configuration variables to use for LocalStack' | ||
required: false | ||
default: '' | ||
ci-project: | ||
description: 'Name of the CI project to track in LocalStack Cloud' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# - name: Initial PR comment | ||
# # TODO: potentially replace with Action version number over time | ||
# uses: LocalStack/setup-localstack/prepare@main | ||
# if: inputs.ci-project && inputs.github-token | ||
# with: | ||
# github-token: ${{ inputs.github-token }} | ||
# ci-project: ${{ inputs.ci-project }} | ||
|
||
- name: Start LocalStack | ||
run: | | ||
pip install pyopenssl -U | ||
if [ "$USE_PRO" = true ]; then | ||
docker pull localstack/localstack-pro:"$IMAGE_TAG" & | ||
CONFIGURATION="$CONFIGURATION DNS_ADDRESS=127.0.0.1" | ||
else | ||
docker pull localstack/localstack:"$IMAGE_TAG" & | ||
fi | ||
pip install localstack | ||
if [ "$INSTALL_AWSLOCAL" = true ]; then | ||
pip install awscli-local[ver1] | ||
fi | ||
export CI_PROJECT=${{ inputs.ci-project }} | ||
eval "${CONFIGURATION} localstack start -d" | ||
localstack wait -t 30 | ||
shell: bash | ||
env: | ||
IMAGE_TAG: "${{ inputs.image-tag }}" | ||
INSTALL_AWSLOCAL: "${{ inputs.install-awslocal }}" | ||
USE_PRO: "${{ inputs.use-pro }}" | ||
CONFIGURATION: "${{ inputs.configuration }}" | ||
|
||
# TODO: potentially add an additional step here to create preview envs, and add a switch to | ||
# enable/disable the "Start LocalStack" action above. This way we could make this action | ||
# the single entry point which then delegates to sub-actions in this repo, based on the | ||
# user-provided configuration... |