diff --git a/Dockerfile b/Dockerfile index ae0c8ef6e58..374414ff0ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,10 @@ WORKDIR /scancode-toolkit # Copy sources into docker container COPY . /scancode-toolkit -# Run scancode once for initial configuration, with -# --reindex-licenses to create the base license index -RUN ./scancode --reindex-licenses +# Initial configuration using ./configure, scancode-reindex-licenses to build +# the base license index +RUN ./configure \ + && ./venv/bin/scancode-reindex-licenses # Add scancode to path ENV PATH=/scancode-toolkit:$PATH diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c1d2fe47c5e..9cf2598f410 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,6 +7,28 @@ jobs: + +################################################################################ +# Tests building with docker +################################################################################ + + +- job: test_build_and_run_with_docker + steps: + - task: Docker@2 + displayName: Check that building and running using Docker succeeds + inputs: + command: 'build' + Dockerfile: '**/Dockerfile' + tags: | + 'scancode-toolkit' + 'scancode-toolkit:$(Build.BuildId)' + - script: | + docker run -v $PWD/:/project scancode-toolkit -clipeu \ + --json-pp /project/scan-result.json /project/apache-2.0.LICENSE + displayName: 'Test run' + + ################################################################################ # These jobs are using VMs and Azure-provided Pythons 3.8 ################################################################################