best-xylophone-4755
02/21/2020, 9:33 AMenough-analyst-54434
02/21/2020, 5:46 PMContinuous Integration
section. It may be a bit out of date. The main point though is you can run pants just like you'd run any other step in Jenkins. In the example a small bash script is used to coordinate a few pants calls. Since Jenkins can shell out to bash, you can do pretty much anything you can do on your workstation on Jenkins by encoding those steps in a bash script.
There are other ways to do this, but I'm mainly pointing out pants is not special in this regard. You just run it like you'd run any other tool without a dedicated Jenkins plugin.best-xylophone-4755
02/22/2020, 5:55 AMenough-analyst-54434
02/23/2020, 10:01 PM./pants
script checked into a repo if and only if pants is not already installed, so this should work automatically. In other words, if the Jenkins job Pants command is ./pants test ...
and Pants is already installed by a prior run of ./pants
on the worker node, the tests will run. If not, Pants will be installed and then the tests run. See: https://www.pantsbuild.org/install.htmlbest-xylophone-4755
02/24/2020, 2:17 PMbest-xylophone-4755
02/24/2020, 2:19 PMbest-xylophone-4755
02/24/2020, 2:21 PMbest-xylophone-4755
02/24/2020, 2:29 PMenough-analyst-54434
02/24/2020, 3:34 PM$ git log --stat -1
commit b0c937eaf48493cfe66d28c66667bfd8cd65264b (HEAD -> master) Author: John Sirois <john.sirois@gmail.com> Date: Mon Feb 24 07:26:04 2020 -0800 Move under src/python.
{common => src/python/common}/BUILD | 0 {common => src/python/common}/__init__.py | 0 {common => src/python/common}/utils.py | 0 {reaper => src/python/reaper}/BUILD | 4 ++-- {reaper => src/python/reaper}/__init__.py | 0 {reaper => src/python/reaper}/app.py | 0
{reaper => src/python/reaper}/processing/BUILD | 0 {reaper => src/python/reaper}/processing/__init__.py | 0 {reaper => src/python/reaper}/processing/add_name.py | 0 9 files changed, 2 insertions(+), 2 deletions(-) $ git diff HEAD~1 diff --git a/common/BUILD b/src/python/common/BUILD
similarity index 100% rename from common/BUILD rename to src/python/common/BUILD diff --git a/common/__init__.py b/src/python/common/__init__.py similarity index 100% rename from common/__init__.py
rename to src/python/common/__init__.py diff --git a/common/utils.py b/src/python/common/utils.py similarity index 100% rename from common/utils.py rename to src/python/common/utils.py diff --git a/reaper/BUILD b/src/python/reaper/BUILD similarity index 59% rename from reaper/BUILD rename to src/python/reaper/BUILD index 4539170..874338b 100644 --- a/reaper/BUILD +++ b/src/python/reaper/BUILD @@ -2,8 +2,8 @@ python_library(name='reaper') python_binary(name='main',
dependencies=[ - 'reaper/processing', - 'common:Common' + 'src/python/reaper/processing', + 'src/python/common:Common' ],
source='app.py' ) diff --git a/reaper/__init__.py b/src/python/reaper/__init__.py similarity index 100% rename from reaper/__init__.py rename to src/python/reaper/__init__.py
diff --git a/reaper/app.py b/src/python/reaper/app.py similarity index 100% rename from reaper/app.py rename to src/python/reaper/app.py diff --git a/reaper/processing/BUILD b/src/python/reaper/processing/BUILD similarity index 100% rename from reaper/processing/BUILD rename to src/python/reaper/processing/BUILD diff --git a/reaper/processing/__init__.py b/src/python/reaper/processing/__init__.py similarity index 100% rename from reaper/processing/__init__.py rename to src/python/reaper/processing/__init__.py diff --git a/reaper/processing/add_name.py b/src/python/reaper/processing/add_name.py similarity index 100% rename from reaper/processing/add_name.py rename to src/python/reaper/processing/add_name.py $
best-xylophone-4755
02/24/2020, 4:28 PMbest-xylophone-4755
02/24/2020, 4:35 PMenough-analyst-54434
02/24/2020, 5:38 PMsrc/python
directories under the app directories.best-xylophone-4755
02/25/2020, 2:53 AMbest-xylophone-4755
02/25/2020, 6:12 AMenough-analyst-54434
02/25/2020, 6:37 AMreaper.src.python.processing
which is not right. The import should be of processing
with no prefix. Your screen shot suggests you're confused by having an incorrect source root in your IDE. You need to right click on the reaper/src/python
directory in the left hand pane and mark it as a source root. Same for all other **/src/python
directories.best-xylophone-4755
02/26/2020, 6:40 AMenough-analyst-54434
02/26/2020, 7:15 AMbest-xylophone-4755
02/26/2020, 7:17 AMbest-xylophone-4755
03/04/2020, 4:56 AM+ ./pants binary reaper/src/python/:main
[31mNo valid Python interpreter found. Pants requires Python 3.6+ to run.[0m
Build step 'Execute shell' marked build as failure
Finished: FAILURE
This is the Jenkins error that I get. How do I solve it?By running it in a docker container with Python 3.6+ installed? Is there a way out without using docker?