Skip to content

Commit

Permalink
Lint with shellcheck (#500)
Browse files Browse the repository at this point in the history
* Fix issues suggested by shellcheck
* Add shellcheck step in the test workflow
  • Loading branch information
mostafa authored Mar 18, 2024
1 parent e88df0a commit ba2d12a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
skip-pkg-cache: true
install-mode: "goinstall"

- name: Lint BASH script with shellcheck 🚨
uses: ludeeus/action-shellcheck@master

- name: Run Go tests 🔬
run: go test -p 1 -cover -covermode atomic -coverprofile=profile.cov -v ./...
env:
Expand Down
14 changes: 7 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
# the latest version of GatewayD from GitHub and install the plugins.

# Get the latest released version of GatewayD from GitHub
[ -z ${GATEWAYD_VERSION} ] && export GATEWAYD_VERSION=$(git ls-remote --tags --sort=v:refname "https://github.com/gatewayd-io/gatewayd" | cut -d/ -f3- | tail -n1)
[ -z "${GATEWAYD_VERSION}" ] && GATEWAYD_VERSION=$(git ls-remote --tags --sort=v:refname "https://github.com/gatewayd-io/gatewayd" | cut -d/ -f3- | tail -n1) && export GATEWAYD_VERSION

# Set the environment variables if they are not set
[ -z ${GATEWAYD_FILES} ] && export GATEWAYD_FILES=/gatewayd-files
[ -z "${GATEWAYD_FILES}" ] && GATEWAYD_FILES=/gatewayd-files && export GATEWAYD_FILES

# Install the required packages
apk add --no-cache curl git

# Create the directory to store the gatewayd files
[ -d ${GATEWAYD_FILES} ] || mkdir ${GATEWAYD_FILES}
[ -d "${GATEWAYD_FILES}" ] || mkdir "${GATEWAYD_FILES}"

cd ${GATEWAYD_FILES}
cd "${GATEWAYD_FILES}" || exit 1

# Download the GatewayD archive if it doesn't exist
[ -f ${GATEWAYD_FILES}/gatewayd-linux-amd64-${GATEWAYD_VERSION}.tar.gz ] || curl -L https://github.com/gatewayd-io/gatewayd/releases/download/${GATEWAYD_VERSION}/gatewayd-linux-amd64-${GATEWAYD_VERSION}.tar.gz | tar zxvf -
[ -f "${GATEWAYD_FILES}"/gatewayd-linux-amd64-"${GATEWAYD_VERSION}".tar.gz ] || curl -L https://github.com/gatewayd-io/gatewayd/releases/download/"${GATEWAYD_VERSION}"/gatewayd-linux-amd64-"${GATEWAYD_VERSION}".tar.gz | tar zxvf -
chmod +x gatewayd

# Install the GatewayD plugins
${GATEWAYD_FILES}/gatewayd plugin install --skip-path-slip-verification --output-dir ${GATEWAYD_FILES} --plugin-config ${GATEWAYD_FILES}/gatewayd_plugins.yaml --cleanup=false --update --overwrite-config
"${GATEWAYD_FILES}"/gatewayd plugin install --skip-path-slip-verification --output-dir "${GATEWAYD_FILES}" --plugin-config "${GATEWAYD_FILES}"/gatewayd_plugins.yaml --cleanup=false --update --overwrite-config

# Replace the default Redis URL
sed -i 's/redis:\/\/localhost:6379/redis:\/\/redis:6379/' ${GATEWAYD_FILES}/gatewayd_plugins.yaml
sed -i 's/redis:\/\/localhost:6379/redis:\/\/redis:6379/' "${GATEWAYD_FILES}"/gatewayd_plugins.yaml

0 comments on commit ba2d12a

Please sign in to comment.