Will Herring
02/07/2023, 9:49 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 10:06 AM# syntax=docker/dockerfile:1
FROM europe-docker.pkg.dev/management1c0c88c4/oci/go:latest AS builder
USER root
ARG NAME
ARG VERSION=unknown
ARG GITHUB_AUTH_TOKEN
ENV VERSION=$VERSION
ENV GITHUB_AUTH_TOKEN=$GITHUB_AUTH_TOKEN
ENV GOOUT=.
COPY . .
RUN \
wget <https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.0/libpact_ffi-linux-x86_64.so.gz>
RUN gunzip libpact_ffi-linux-x86_64.so.gz
RUN mv libpact_ffi-linux-x86_64.so /usr/local/lib/libpact_ffi.so
RUN ldconfig /usr/local/lib/libpact_ffi.so
RUN \
GOMODCACHE=/usr/src/.go/pkg/mod \
go test -c ./internal/provider/mas
# Stage 2 - Copy binary from Build Stage
FROM pactfoundation/pact-cli:latest
COPY --from=builder /mas.test /go-tests
COPY --from=builder /pact/entrypoint.sh /go-tests
ENTRYPOINT ["/go-tests/entrypoint.sh"]
There’s still some stuff I’ve been playing around with in there, but this is the current stateWill Herring
02/07/2023, 10:07 AMgo test -c
commandMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
native
packageMatt (pactflow.io / pact-js / pact-go)
"<http://github.com/pact-foundation/pact-go/v2/internal/native|github.com/pact-foundation/pact-go/v2/internal/native>"
Matt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 10:38 AMWill Herring
02/07/2023, 10:40 AM<http://github.com/pact-foundation/pact-go/v2|github.com/pact-foundation/pact-go/v2>
anyways right?Will Herring
02/07/2023, 10:42 AMgo.sum
currently has the following two lines
<http://github.com/pact-foundation/pact-go/v2|github.com/pact-foundation/pact-go/v2> v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0 h1:z0o1WaPGcDEHQ8uNRfwL0V6OfWqAt7/P26jWmMHn8TA=
<http://github.com/pact-foundation/pact-go/v2|github.com/pact-foundation/pact-go/v2> v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0/go.mod h1:kB2X26JGY+sd07XdG9LI4OK+aY8cTQ/IB56oBg2wT9o=
And go.mod
has
<http://github.com/pact-foundation/pact-go/v2|github.com/pact-foundation/pact-go/v2> v2.0.0-beta.17.0.20230125022501-fa1a8deab0a0
I’ve just used go install
to add themMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 10:56 AMWill Herring
02/07/2023, 10:56 AMMatt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 10:57 AMMatt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 10:57 AMWill Herring
02/07/2023, 10:58 AMMatt (pactflow.io / pact-js / pact-go)
Have you had any experience with running it in github actions? Part of the reason I am where I am is because there didn’t seem to be a clear way to generate the contract in one action, and then pass the contract into the CLI docker image in order to push it into the brokerso you just want to: 1. Run the pact tests 2. Publish the contract file In a single action, or must it be across multiple stages?
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
--branch
because that’s what we tell people to do)Will Herring
02/07/2023, 10:59 AMWill Herring
02/07/2023, 11:00 AMWill Herring
02/07/2023, 11:01 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 11:02 AMMatt (pactflow.io / pact-js / pact-go)
Slackbot
02/07/2023, 11:04 AMMatt (pactflow.io / pact-js / pact-go)
Will Herring
02/07/2023, 11:06 AM