Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue M1 build of the docker image for newman #3154 solved #3302

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
node-version: [16, 18]
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, linux/arm64]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -74,4 +74,7 @@ jobs:
- name: Run library tests
run: |
npm run test-library
bash <(curl -s https://codecov.io/bash) -c -Z -f .coverage/coverage-final.json -F library -t ${{ secrets.CODECOV_TOKEN }}
- name: Run library tests
run: |
npm run test-library
bash <(curl -s https://codecov.io/bash) -c -Z -f .coverage/coverage-final.json -F library -t ${{ secrets.CODECOV_TOKEN }}
33 changes: 15 additions & 18 deletions docker/images/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
# Use Node 16 Alpine base image
FROM node:16-alpine
LABEL maintainer="Postman Labs <[email protected]>"

# Define build argument for Newman version
ARG NEWMAN_VERSION

# Set environment variables
# Set environment variables for localization
ENV LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8" ALPINE_NODE_REPO="oznu/alpine-node"

# Bail out early if NODE_VERSION is not provided
# Bail out early if NEWMAN_VERSION is not provided in a valid semver format
RUN if [ ! $(echo $NEWMAN_VERSION | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+$") ]; then \
echo "\033[0;31mA valid semver Newman version is required in the NEWMAN_VERSION build-arg\033[0m"; \
exit 1; \
fi && \
# Install Newman globally
npm install --global newman@${NEWMAN_VERSION};
# Install Newman globally with the specified version
npm install --global newman@${NEWMAN_VERSION} && \
# Update deprecated packages to avoid warnings
npm install --global highlight.js@latest gulp-header@latest urix@latest resolve-url@latest && \
# Install newman-reporter-htmlextra if needed
npm install --global newman-reporter-htmlextra@latest

# Set workdir to /etc/newman
# When running the image, mount the directory containing your collection to this location
#
# docker run -v <path to collections directory>:/etc/newman ...
#
# In case you mount your collections directory to a different location, you will need to give absolute paths to any
# collection, environment files you want to pass to newman, and if you want newman reports to be saved to your disk.
# Or you can change the workdir by using the -w or --workdir flag
# Set work directory for the Newman collection
WORKDIR /etc/newman

# Set newman as the default container command
# Now you can run the container via
#
# docker run -v /home/collections:/etc/newman -t postman/newman_alpine run YourCollection.json.postman_collection \
# -e YourEnvironment.postman_environment \
# -H newman_report.html
ENTRYPOINT ["newman"]

# Verify that newman and required dependencies are correctly installed
RUN newman --version && \
npm list -g highlight.js gulp-header urix resolve-url newman-reporter-htmlextra
Loading