From 452ab484d401b9dff11407973e762b78f30725b4 Mon Sep 17 00:00:00 2001 From: Rose Judge Date: Fri, 19 Mar 2021 11:04:34 -0700 Subject: [PATCH] Add jq dependency to Dockerfiles and README Commit e0785a0 introduced new functionality that uses the host system's jq package utility to detect and parse npm package metadata. This commit adds jq as a dependency to the Tern Dockerfiles and also updates the CI tests to add a npm-based docker image, node:12.16-alpine, as a test image. Finally, this PR updates the README to include jq as a host system dependency. Signed-off-by: Rose Judge --- README.md | 3 ++- ci/Dockerfile | 1 + ci/test_files_touched.py | 7 ++++--- docker/Dockerfile | 1 + docker/Dockerfile.scancode | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 578884df..125f0ae4 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,9 @@ If you have a Linux OS you will need a distro with a kernel version >= 4.0 (Ubun - attr (sudo apt-get install attr or sudo dnf install attr) - Python 3.6 or newer (sudo apt-get install python3.6(3.7) or sudo dnf install python36(37)) - Pip (sudo apt-get install python3-pip). +- jq (sudo apt-get install jq or sudo dnf install jq) -Some distro versions have all of these except `attr` preinstalled but `attr` is a common utility and is available via the package manager. +Some distro versions have all of these except `attr` and/or `jq` preinstalled but both are common utilities and are available via the package manager. For Docker containers - Docker CE (Installation instructions can be found here: https://docs.docker.com/engine/installation/#server) diff --git a/ci/Dockerfile b/ci/Dockerfile index 338f173e..2e553a7f 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update && \ findutils \ git \ gnupg2 \ + jq \ python3 \ python3-pip \ python3-setuptools \ diff --git a/ci/test_files_touched.py b/ci/test_files_touched.py index 492f972d..14f2a41c 100644 --- a/ci/test_files_touched.py +++ b/ci/test_files_touched.py @@ -38,7 +38,7 @@ # requirements.txt re.compile('requirements.txt'): ['tern report -i photon:3.0'], # Dockerfile - re.compile('Dockerfile'): [ + re.compile('docker/Dockerfile'): [ 'python3 setup.py sdist && ' 'docker build -t ternd -f ci/Dockerfile . && ' './docker_run.sh ternd "report -i golang:alpine"'], @@ -69,12 +69,13 @@ 'tern report -f spdxtagvalue -i photon:3.0', 'tern lock docker/Dockerfile'], # tern/command_lib - re.compile('tern/command_lib'): [ + re.compile('tern/analyze/default/command_lib'): [ 'tern report -i photon:3.0', 'tern report -i debian:buster', 'tern report -i alpine:3.9', 'tern report -i archlinux:latest', - 'tern report -i centos:7'], + 'tern report -i centos:7', + 'tern report -i node:12.16-alpine'], # tern/analyze/default/dockerfile re.compile('tern/analyze/default/dockerfile'): [ 'python tests/test_analyze_default_dockerfile_parse.py', diff --git a/docker/Dockerfile b/docker/Dockerfile index b22c9425..6ac3d32f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update && \ findutils \ git \ gnupg2 \ + jq \ python3 \ python3-pip \ python3-setuptools \ diff --git a/docker/Dockerfile.scancode b/docker/Dockerfile.scancode index 1ab3f1b6..be99d781 100644 --- a/docker/Dockerfile.scancode +++ b/docker/Dockerfile.scancode @@ -10,6 +10,7 @@ RUN apt-get update && \ findutils \ git \ gnupg2 \ + jq \ python3 \ python3-pip \ python3-setuptools \