Tatiana
11/08/2022, 7:02 PM"@pact_foundation/pact": "^10.1.4" for my consumer testing. I added consumer tests but I didn’t include tests to CI pipeline, so the consumer tests are not executed in the pipeline yet.
However, my build job is failing in my CI pipeline with errors regarding Python (errors attached in thread).
build job looks like:
build:
stage: build
variables:
ENV: "localhost"
NPM_TOKEN: '$CI_JOB_TOKEN'
before_script:
- gitlab/configure-npm.sh
- apk add --update make
script:
- make set-environment ENV=$ENV
- yarn install --frozen-lockfile
- make build
artifacts:
paths:
- dist
gitlab/configure-npm.sh looks like:
#!/bin/sh
set -o errexit
set -x
yarn config set -H npmScopes.codility.npmRegistryServer "<https://gitlab.codility.net/api/v4/projects/519/packages/npm/>"
yarn config set -H npmScopes.codility.npmAuthToken "${NPM_TOKEN}"
I use gitlab-ci, the app uses TS, React, yarn.
Also, as I can see we don’t use docker-compose, dockerfile in our app. But in CI logs I see:
Running with gitlab-runner 15.5.0 (0d4137b8)
on gitlab-runners-manager-spot-c5-
Resolving secrets
00:00
Preparing the "docker+machine" executor
00:08
Using Docker executor with image node:16.13.0-alpine ...
Pulling docker image node:16.13.0-alpine ...
Using docker image sha256:44e24535dfbf4b7415c16a5828 for node:16.13.0-alpine with digest node@sha256:60ef0bed1dc2ec835cfe3c4 ...
I suspect that I need to install python3, but I am not sure if I should do it since it’s React app.
Please advice 🙏Tatiana
11/08/2022, 7:02 PM➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python Python is not set from command line or npm configuration
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python Python is not set from environment variable PYTHON
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python checking if "python3" can be used
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python - "python3" is not in PATH or produced an error
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python checking if "python" can be used
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python - "python" is not in PATH or produced an error
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python You need to install the latest version of Python.
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python you can try one of the following options:
➤ YN0000: │ @pact-foundation/pact-core@npm:13.9.0 STDERR gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"Tatiana
11/08/2022, 7:03 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Tatiana
11/08/2022, 9:53 PMTatiana
11/14/2022, 12:51 PMMatt (pactflow.io / pact-js / pact-go)
FROM node:18
RUN apt-get update -y && \
apt-get install -y git g++ python3 build-essential && \
rm -rf /var/lib/apt/lists/*
COPY ./ /app/
WORKDIR /app
RUN npm install
CMD ["npm", "t"]
That image should get you what you needTatiana
11/14/2022, 10:08 PMMatt (pactflow.io / pact-js / pact-go)
Tatiana
11/14/2022, 10:55 PMbuild job in the .gitlab-ci.yaml file with python and using debian node image. Because after installing pact library I had errors described above in the CI/CD.
Anyway, you helped me! I used installation commands from your message and my build was successful 👍 Thank you very much, you’re helping me a lot with Pact!Matt (pactflow.io / pact-js / pact-go)
node-gyp process that prints out possible causes and solutions. But outside of the build logs, where did you go for help? (befaure coming here, obviously 😛 )Tatiana
11/15/2022, 6:53 PM