generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·34 lines (23 loc) · 1.11 KB
/
entrypoint.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
33
34
#!/bin/sh
export RUNNER_GITHUB_WORKSPACE_PATH="$1"
export RUNNER_HOVERFLY_INSTALL_PATH="$RUNNER_GITHUB_WORKSPACE_PATH/bin"
export CONTAINER_HOVERFLY_INSTALL_PATH="$GITHUB_WORKSPACE/bin"
export HOVERFLY_PLATFORM=linux_amd64
export HOVERFLY_VERSION="$INPUT_VERSION"
export HOVERFLY_BUNDLE=hoverfly_bundle_$HOVERFLY_PLATFORM
export HOVERFLY_DOWNLOAD_URL=https://github.com/SpectoLabs/hoverfly/releases/download/
mkdir -p "$CONTAINER_HOVERFLY_INSTALL_PATH"
# make the script that enables https calls to be simulated accessible to the consumer
install -m 755 /install-and-trust-hoverfly-default-cert.sh "$CONTAINER_HOVERFLY_INSTALL_PATH"
mkdir -p /tmp/hoverfly
cd /tmp/hoverfly || exit
wget "$HOVERFLY_DOWNLOAD_URL$HOVERFLY_VERSION/$HOVERFLY_BUNDLE.zip"
unzip $HOVERFLY_BUNDLE.zip
install -m 755 hoverfly "$CONTAINER_HOVERFLY_INSTALL_PATH"
install -m 755 hoverctl "$CONTAINER_HOVERFLY_INSTALL_PATH"
cd /tmp || exit
rm -rf /tmp/hoverfly
echo "Installed hoverfly and hoverctl"
"$CONTAINER_HOVERFLY_INSTALL_PATH/hoverfly" -version
"$CONTAINER_HOVERFLY_INSTALL_PATH/hoverctl" version
echo "$RUNNER_HOVERFLY_INSTALL_PATH" >> "$GITHUB_PATH"