Skip to content

Commit

Permalink
Update Dockerfile and add build test #3955
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <jyang@nexb.com>
  • Loading branch information
JonoYang committed Oct 22, 2024
1 parent 6e42937 commit 806cb08
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# See https://aboutcode.org for more information about nexB OSS projects.
#

FROM --platform=linux/amd64 python:3.8-slim-buster
FROM --platform=linux/amd64 python:3.12.7-slim-bookworm

# Python settings: Force unbuffered stdout and stderr (i.e. they are flushed to terminal immediately)
ENV PYTHONUNBUFFERED 1
Expand Down
17 changes: 13 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ jobs:
python_architecture: x64
test_suites:
click_versions: |
for clk_ver in 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.3 8.0.2 8.0.1 7.1.2 7.1.1 7.1 6.7;
for clk_ver in 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.3 8.0.2 8.0.1 7.1.2 7.1.1 7.1 6.7;
do
venv/bin/pip install click==$clk_ver;
venv/bin/scancode -i samples/ -n3 --json foo.json;
venv/bin/scancode -i --verbose samples/ -n3 --json foo.json;
venv/bin/scancode -i samples/ -n3 --json foo.json;
venv/bin/scancode -i --verbose samples/ -n3 --json foo.json;
done
Expand All @@ -230,7 +230,7 @@ jobs:
python_versions: ['3.9', '3.10', '3.11', '3.12']
test_suites:
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos12_cpython_latest_from_pip
Expand Down Expand Up @@ -263,3 +263,12 @@ jobs:
test_suites:
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py


################################################################################
# Test container build
################################################################################

- template: etc/ci/azure-posix-docker.yml
parameters:
job_name: ubuntu22_build_container
image_name: ubuntu-22.04
33 changes: 33 additions & 0 deletions etc/ci/azure-posix-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
job_name: ''
image_name: ''
python_versions: []
test_suites: {}
python_architecture: x64

jobs:
- job: ${{ parameters.job_name }}

pool:
vmImage: ${{ parameters.image_name }}

strategy:
matrix:
${{ each tsuite in parameters.test_suites }}:
${{ tsuite.key }}:
test_suite_label: ${{ tsuite.key }}
test_suite: ${{ tsuite.value }}

steps:
- checkout: self
fetchDepth: 10

- task: Docker@2
inputs:
command: 'build'
Dockerfile: '**/Dockerfile'
tags: 'scancode'
displayName: 'Build scancode-toolkit container'

- script: |
docker run scancode --help

0 comments on commit 806cb08

Please # to comment.