Skip to content

Commit 7af650b

Browse files
authored
Merge pull request #507 from YOU54F/feat/cli_as_lib
Feat/cli as lib
2 parents fa52876 + 63b8ce4 commit 7af650b

File tree

15 files changed

+86
-71
lines changed

15 files changed

+86
-71
lines changed

.github/workflows/build-ffi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
17+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
1818
rust: [ stable ]
1919
env:
2020
pact_do_not_track: true

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
17+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
1818
env:
1919
pact_do_not_track: true
2020
steps:

.github/workflows/compatability-suite.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
20+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
2121
steps:
2222
- uses: actions/checkout@v2
2323
- uses: dtolnay/rust-toolchain@stable
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
32+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
3333
steps:
3434
- uses: actions/checkout@v2
3535
- uses: dtolnay/rust-toolchain@stable
@@ -41,7 +41,7 @@ jobs:
4141
strategy:
4242
fail-fast: false
4343
matrix:
44-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
44+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
4545
steps:
4646
- uses: actions/checkout@v2
4747
- uses: dtolnay/rust-toolchain@stable
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
operating-system: [ ubuntu-latest, windows-latest, macos-13, macos-14 ]
56+
operating-system: [ ubuntu-latest, windows-latest, macos-15, macos-15-intel ]
5757
steps:
5858
- uses: actions/checkout@v2
5959
- uses: dtolnay/rust-toolchain@stable

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
targets: x86_64-pc-windows-msvc
3131
- operating-system: windows-2022
3232
targets: aarch64-pc-windows-msvc
33-
- operating-system: macos-13
33+
- operating-system: macos-15-intel
3434
targets: x86_64-apple-darwin
35-
- operating-system: macos-14
35+
- operating-system: macos-15
3636
targets: aarch64-apple-darwin
3737
fail-fast: false
3838

rust/pact_verifier_cli/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ FROM --platform=$BUILDPLATFORM rust:1-alpine3.21 AS builder
33
ARG BIN_ARCH=x86_64
44
ARG VERSION=1.1.1
55

6-
RUN wget -O pact_verifier_cli.gz https://github.com/pact-foundation/pact-reference/releases/download/pact_verifier_cli-v${VERSION}/pact_verifier_cli-linux-${BIN_ARCH}.gz
7-
RUN gunzip pact_verifier_cli.gz
8-
RUN chmod +x pact_verifier_cli
6+
RUN wget -O pact-verifier.gz https://github.com/pact-foundation/pact-reference/releases/download/pact_verifier_cli-v${VERSION}/pact-verifier-linux-${BIN_ARCH}.gz
7+
RUN gunzip pact-verifier.gz
8+
RUN chmod +x pact-verifier
99

1010
# Now, we need to build our _real_ Docker container, copying in the executable.
1111
FROM --platform=$BUILDPLATFORM alpine:3.21
1212
RUN apk --no-cache add ca-certificates
1313
COPY --from=builder \
14-
/pact_verifier_cli \
14+
/pact-verifier \
1515
/usr/local/bin/
1616

17-
ENTRYPOINT ["/usr/local/bin/pact_verifier_cli"]
17+
ENTRYPOINT ["/usr/local/bin/pact-verifier"]

rust/pact_verifier_cli/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ back against the one defined in the pact file. All mismatches will then be repor
1111

1212
## Command line interface
1313

14-
The pact verifier is bundled as a single binary executable `pact_verifier_cli`. Running this without any options
14+
The pact verifier is bundled as a single binary executable `pact-verifier`. Running this without any options
1515
displays the standard help.
1616

1717
```console
18-
$ pact_verifier_cli,ignore
18+
$ pact-verifier,ignore
1919
Standalone pact verifier for provider pact verification
2020

21-
Usage: pact_verifier_cli [OPTIONS]
21+
Usage: pact-verifier [OPTIONS]
2222

2323
Options:
2424
--help Print help and exit
@@ -253,7 +253,7 @@ The `--last-failed` option will only execute interactions that have previously f
253253
This will verify all the pacts for the `happy_provider` found in the pact broker (running on localhost) against the provider running on localhost port 5050. Only the pacts for the consumers `Consumer` and `Consumer2` will be verified.
254254

255255
```console,ignore
256-
$ pact_verifier_cli -b http://localhost -n 'happy_provider' -p 5050 --filter-consumer Consumer --filter-consumer Consumer2
256+
$ pact-verifier -b http://localhost -n 'happy_provider' -p 5050 --filter-consumer Consumer --filter-consumer Consumer2
257257
21:59:28 [WARN] pact_matching::models: No metadata found in pact file "http://localhost/pacts/provider/happy_provider/consumer/Consumer/version/1.0.0", assuming V1.1 specification
258258
21:59:28 [WARN] pact_matching::models: No metadata found in pact file "http://localhost/pacts/provider/happy_provider/consumer/Consumer2/version/1.0.0", assuming V1.1 specification
259259

rust/pact_verifier_cli/release-docker.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ if [ "" = "$1" ]; then
99
fi
1010

1111
# AMD64
12-
docker build . -t pactfoundation/pact-ref-verifier:$1-amd64 --platform linux/amd64 \
12+
docker build . -t pactfoundation/pact-verifier:$1-amd64 --platform linux/amd64 \
1313
--build-arg ARCH=amd64/ --build-arg BIN_ARCH=x86_64 --build-arg VERSION=$1
14-
docker push pactfoundation/pact-ref-verifier:$1-amd64
14+
docker push pactfoundation/pact-verifier:$1-amd64
1515

1616
# ARM64V8
17-
docker build . -t pactfoundation/pact-ref-verifier:$1-arm64v8 --platform linux/arm64 \
17+
docker build . -t pactfoundation/pact-verifier:$1-arm64v8 --platform linux/arm64 \
1818
--build-arg ARCH=arm64v8/ --build-arg BIN_ARCH=aarch64 --build-arg VERSION=$1
19-
docker push pactfoundation/pact-ref-verifier:$1-arm64v8
19+
docker push pactfoundation/pact-verifier:$1-arm64v8
2020

2121
# Create Manifest
22-
docker manifest create pactfoundation/pact-ref-verifier:$1 \
23-
--amend pactfoundation/pact-ref-verifier:$1-amd64 \
24-
--amend pactfoundation/pact-ref-verifier:$1-arm64v8
25-
docker manifest push pactfoundation/pact-ref-verifier:$1
26-
docker manifest create pactfoundation/pact-ref-verifier:latest \
27-
--amend pactfoundation/pact-ref-verifier:$1-amd64 \
28-
--amend pactfoundation/pact-ref-verifier:$1-arm64v8
29-
docker manifest push pactfoundation/pact-ref-verifier:latest
22+
docker manifest create pactfoundation/pact-verifier:$1 \
23+
--amend pactfoundation/pact-verifier:$1-amd64 \
24+
--amend pactfoundation/pact-verifier:$1-arm64v8
25+
docker manifest push pactfoundation/pact-verifier:$1
26+
docker manifest create pactfoundation/pact-verifier:latest \
27+
--amend pactfoundation/pact-verifier:$1-amd64 \
28+
--amend pactfoundation/pact-verifier:$1-arm64v8
29+
docker manifest push pactfoundation/pact-verifier:latest

rust/pact_verifier_cli/release-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
set -x
55

66
RUST_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7-
APP_NAME=pact_verifier_cli
7+
APP_NAME=pact-verifier
88

99
source "$RUST_DIR/scripts/gzip-and-sum.sh"
1010
ARTIFACTS_DIR=${ARTIFACTS_DIR:-"$RUST_DIR/release_artifacts"}

rust/pact_verifier_cli/release-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
set -x
55

66
RUST_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7-
APP_NAME=pact_verifier_cli
7+
APP_NAME=pact-verifier
88

99
source "$RUST_DIR/scripts/gzip-and-sum.sh"
1010
ARTIFACTS_DIR=${ARTIFACTS_DIR:-"$RUST_DIR/release_artifacts"}

rust/pact_verifier_cli/release-win.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
set -x
55

66
RUST_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7-
APP_NAME=pact_verifier_cli
7+
APP_NAME=pact-verifier
88

99
source "$RUST_DIR/scripts/gzip-and-sum.sh"
1010
ARTIFACTS_DIR=${ARTIFACTS_DIR:-"$RUST_DIR/release_artifacts"}

0 commit comments

Comments
 (0)