forked from t-botz/aws-secrets-manager-read-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-local.sh
executable file
·32 lines (22 loc) · 855 Bytes
/
test-local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
### Run the github action locally using act and docker
### For running a specific job you can use `-j <job>`.
### Example: `./test-local.sh -j test`
### As of now you also need to run localstack with
### docker run --rm -it -p 4566:4566 -e SERVICES=secretsmanager localstack/localstack
### Wait for act to support services (https://github.com/nektos/act/pull/775)
set -e
if ! command -v act > /dev/null 2>&1
then
echo "act needs to be installed. Please visit https://github.com/nektos/act"
exit
fi
docker build -t act-with-awscli - <<EOF
FROM node:16-buster-slim
RUN apt-get update && \
apt -y install curl unzip groff less && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
EOF
act -P ubuntu-latest=act-with-awscli "${@}"