Skip to content

Commit

Permalink
Merge pull request #115 from pact-foundation/feat/use_sh_wrappers
Browse files Browse the repository at this point in the history
Feat/use sh wrappers
  • Loading branch information
YOU54F authored Feb 8, 2024
2 parents 217815b + 1f03a9e commit d9faf54
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 43 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
test:
defaults:
run:
shell: bash
shell: ${{ matrix.shell }}
needs: [build]
strategy:
fail-fast: false
matrix:
os: ["windows-latest","ubuntu-latest","macos-latest"]
shell: ["sh","bash"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -46,4 +47,4 @@ jobs:
run: ./script/unpack-and-test.sh
env:
BINARY_OS: 'windows'
BINARY_ARCH: 'x86'
BINARY_ARCH: 'x86'
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"]
6 changes: 3 additions & 3 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 @@ -16,7 +16,7 @@ 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" "$@"
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ 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 Down
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ 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 Down
6 changes: 3 additions & 3 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 @@ -16,7 +16,7 @@ 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 Down
6 changes: 3 additions & 3 deletions packaging/pact-publish.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 @@ -16,7 +16,7 @@ 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 Down
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ 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 Down
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ 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 Down
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ 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 Down

0 comments on commit d9faf54

Please sign in to comment.