Skip to content

Commit

Permalink
feat: use sh for wrapper scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Aug 4, 2023
1 parent ece878d commit 767aecb
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ debian_x64_task:

STANDALONE_INSTALL_TASK_TEMPLATE: &STANDALONE_INSTALL_TASK_TEMPLATE
install_script: |
curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash \
curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | sh \
&& ln -s $PWD/pact/bin/* /usr/local/bin \
&& ls pact/bin/ \
&& ls /usr/local/bin
Expand Down Expand Up @@ -178,7 +178,7 @@ cli_test_alpine_arm_task:
arm_container:
image: $IMAGE
<<: *DOCKER_ARGS_ARM64_TEMPLATE
curl_script: apk add curl bash gcompat libc6-compat
curl_script: apk add curl sh gcompat libc6-compat
<<: *STANDALONE_INSTALL_TASK_TEMPLATE
<<: *TEST_RUBY_CLI_TASK_TEMPLATE

Expand Down Expand Up @@ -208,7 +208,7 @@ cli_test_alpine_task:
container:
image: $IMAGE
<<: *DOCKER_ARGS_ARM64_TEMPLATE
curl_script: apk add curl bash gcompat libc6-compat
curl_script: apk add curl sh gcompat libc6-compat
<<: *STANDALONE_INSTALL_TASK_TEMPLATE
<<: *TEST_RUBY_CLI_TASK_TEMPLATE

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
test:
defaults:
run:
shell: bash
shell: sh
needs: [build]
strategy:
fail-fast: false
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile.alpine.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM arm64v8/alpine
WORKDIR ../

ARG TARGET_ARCH
ARG PACT_VERSION
ARG PACT_CLI_VERSION
ARG TARGET_ARCH=${TARGET_ARCH:-arm64}
ARG PACT_VERSION=${PACT_VERSION:-2.0.1}
ARG PACT_CLI_VERSION=${PACT_CLI_VERSION:-2.0.1}

RUN apk --no-cache add gcompat libc6-compat bash
RUN apk --no-cache add gcompat libc6-compat

RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_VERSION}/pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_CLI_VERSION}/pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& ln -s /pact/bin/* /usr/local/bin

ENTRYPOINT ["pact-mock-service"]
12 changes: 6 additions & 6 deletions Dockerfile.alpine.x64
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ FROM alpine:latest
WORKDIR ../

ARG TARGET_ARCH
ARG PACT_VERSION
ARG PACT_CLI_VERSION
ARG TARGET_ARCH=${TARGET_ARCH:-arm64}
ARG PACT_VERSION=${PACT_VERSION:-2.0.1}
ARG PACT_CLI_VERSION=${PACT_CLI_VERSION:-2.0.1}

RUN apk --no-cache add gcompat libc6-compat bash
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_VERSION}/pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
RUN apk --no-cache add gcompat libc6-compat
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_CLI_VERSION}/pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& ln -s /pact/bin/* /usr/local/bin

ENTRYPOINT ["pact-mock-service"]
10 changes: 5 additions & 5 deletions Dockerfile.debian.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ FROM debian:11-slim
WORKDIR ../

ARG TARGET_ARCH
ARG PACT_VERSION
ARG PACT_CLI_VERSION
ARG TARGET_ARCH=${TARGET_ARCH:-arm64}
ARG PACT_VERSION=${PACT_VERSION:-2.0.1}
ARG PACT_CLI_VERSION=${PACT_CLI_VERSION:-2.0.1}

RUN apt update --yes && apt install wget --yes
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_VERSION}/pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_CLI_VERSION}/pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& ln -s /pact/bin/* /usr/local/bin

ENTRYPOINT ["pact-mock-service"]
10 changes: 5 additions & 5 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ FROM ubuntu:latest
WORKDIR ../

ARG TARGET_ARCH
ARG PACT_VERSION
ARG PACT_CLI_VERSION
ARG TARGET_ARCH=${TARGET_ARCH:-arm64}
ARG PACT_VERSION=${PACT_VERSION:-2.0.1}
ARG PACT_CLI_VERSION=${PACT_CLI_VERSION:-2.0.1}

RUN apt update --yes && apt install wget --yes
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_VERSION}/pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_VERSION}-linux-${TARGET_ARCH}.tar.gz \
RUN wget -q https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v${PACT_CLI_VERSION}/pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& tar xzf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& rm -rf pact-${PACT_CLI_VERSION}-linux-${TARGET_ARCH}.tar.gz \
&& ln -s /pact/bin/* /usr/local/bin

ENTRYPOINT ["pact-mock-service"]
8 changes: 4 additions & 4 deletions packaging/pact-broker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-broker.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-broker.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pact-message.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-message.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-message.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pact-mock-service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-mock-service.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-mock-service.rb" "$@"
10 changes: 5 additions & 5 deletions packaging/pact-provider-verifier.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="${BASH_SOURCE[0]}"
SOURCE="$0"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
START="$( echo "$TARGET" | cut -c 1 )"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rbundler/setup -rreadline -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-provider-verifier.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rbundler/setup -rreadline -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-provider-verifier.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pact-publish.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="${BASH_SOURCE[0]}"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rbundler/setup -rreadline -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-publish.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rbundler/setup -rreadline -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-publish.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pact-stub-service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-stub-service.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact-stub-service.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pact.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pact.rb" "$@"
8 changes: 4 additions & 4 deletions packaging/pactflow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

SOURCE="$0"
Expand All @@ -12,11 +12,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
RDIR="$( dirname "$SOURCE" )"
# RDIR="$( dirname "$SOURCE" )"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Figure out where this script is located.
LIBDIR="`cd \"$DIR\" && cd ../lib && pwd`"
LIBDIR="$(cd "$DIR" && cd ../lib && pwd)"

# Tell Bundler where the Gemfile and gems are.
export BUNDLE_GEMFILE="$LIBDIR/vendor/Gemfile"
Expand All @@ -26,4 +26,4 @@ unset BUNDLE_APP_CONFIG
export BUNDLE_FROZEN=1

# Run the actual app using the bundled Ruby interpreter, with Bundler activated.
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pactflow.rb" "$@"
exec "$LIBDIR/ruby/bin/ruby" -E UTF-8 -rreadline -rbundler/setup -I "$LIBDIR/app/lib" "$LIBDIR/app/pactflow.rb" "$@"

0 comments on commit 767aecb

Please sign in to comment.