Skip to content

Commit a217d59

Browse files
Alexandre LandeauAlexandre Landeau
authored andcommitted
Matched new plugin template jenkins files
1 parent 6066ccf commit a217d59

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ pipeline {
5151
}
5252
}
5353
}
54-
}
54+
}

Makefile

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
SHELL:=/bin/bash
2-
31
# Makefile variables set automatically
42
plugin_id=`cat plugin.json | python -c "import sys, json; print(str(json.load(sys.stdin)['id']).replace('/',''))"`
53
plugin_version=`cat plugin.json | python -c "import sys, json; print(str(json.load(sys.stdin)['version']).replace('/',''))"`
@@ -9,7 +7,7 @@ last_commit_id=`git rev-parse HEAD`
97

108

119
plugin:
12-
@echo "Archiving plugin to dist/ folder..."
10+
@echo "[START] Archiving plugin to dist/ folder..."
1311
@cat plugin.json | json_pp > /dev/null
1412
@rm -rf dist
1513
@mkdir dist
@@ -18,41 +16,41 @@ plugin:
1816
@zip --delete dist/${archive_file_name} "tests/*"
1917
@zip -u dist/${archive_file_name} release_info.json
2018
@rm release_info.json
21-
@echo "Archiving plugin to dist/ folder: Done!"
19+
@echo "[SUCCESS] Archiving plugin to dist/ folder: Done!"
2220

23-
.ONESHELL:
2421
unit-tests:
25-
@set -e
2622
@echo "Running unit tests..."
27-
@PYTHON_VERSION=`python3 -V 2>&1 | sed 's/[^0-9]*//g' | cut -c 1,2`
28-
@PYTHON_VERSION_IS_CORRECT=`cat code-env/python/desc.json | python3 -c "import sys, json; print(str($$PYTHON_VERSION) in [x[-2:] for x in json.load(sys.stdin)['acceptedPythonInterpreters']]);"`
29-
@if [ $$PYTHON_VERSION_IS_CORRECT == "False" ]; then echo "Python version $$PYTHON_VERSION is not in acceptedPythonInterpreters"; exit 1; else echo "Python version $$PYTHON_VERSION is in acceptedPythonInterpreters"; fi
30-
@rm -rf ./env/
31-
@python3 -m venv env/
32-
@source env/bin/activate
33-
@pip install --upgrade pip
34-
@pip install --no-cache-dir -r tests/python/unit/requirements.txt
35-
@pip install --no-cache-dir -r code-env/python/spec/requirements.txt
36-
@export PYTHONPATH="$(PYTHONPATH):$(PWD)/python-lib"
37-
@export FONT_FOLDER_PATH="$(PWD)/resource/fonts"
38-
@export STOPWORDS_FOLDER_PATH="$(PWD)/resource/stopwords"
39-
@export TEST_RESOURCE_FOLDER_PATH="$(PWD)/tests/resource"
40-
@pytest tests/python/unit --alluredir=tests/allure_report
41-
@echo "Running unit tests: Done!"
23+
@( \
24+
PYTHON_VERSION=`python3 -V 2>&1 | sed 's/[^0-9]*//g' | cut -c 1,2`; \
25+
PYTHON_VERSION_IS_CORRECT=`cat code-env/python/desc.json | python3 -c "import sys, json; print(str($$PYTHON_VERSION) in [x[-2:] for x in json.load(sys.stdin)['acceptedPythonInterpreters']]);"`; \
26+
if [ $$PYTHON_VERSION_IS_CORRECT == "False" ]; then echo "Python version $$PYTHON_VERSION is not in acceptedPythonInterpreters"; exit 1; else echo "Python version $$PYTHON_VERSION is in acceptedPythonInterpreters"; fi; \
27+
)
28+
@( \
29+
rm -rf ./env/; \
30+
python3 -m venv env/; \
31+
source env/bin/activate; \
32+
pip install --upgrade pip;\
33+
pip install --no-cache-dir -r tests/python/unit/requirements.txt; \
34+
pip install --no-cache-dir -r code-env/python/spec/requirements.txt; \
35+
export PYTHONPATH="$(PYTHONPATH):$(PWD)/python-lib"; \
36+
export FONT_FOLDER_PATH="$(PWD)/resource/fonts"; \
37+
export STOPWORDS_FOLDER_PATH="$(PWD)/resource/stopwords"; \
38+
export TEST_RESOURCE_FOLDER_PATH="$(PWD)/tests/resource"; \
39+
pytest tests/python/unit --alluredir=tests/allure_report || ret=$$?; exit $$ret \
40+
)
4241

43-
.ONESHELL:
4442
integration-tests:
45-
@set -e
4643
@echo "Running integration tests..."
47-
@rm -rf ./env/
48-
@python3 -m venv env/
49-
@source env/bin/activate
50-
@pip install --upgrade pip
51-
@pip install --no-cache-dir -r tests/python/integration/requirements.txt
52-
@pytest tests/python/integration --alluredir=tests/allure_report
53-
@echo "Running integration tests: Done!"
44+
@( \
45+
rm -rf ./env/; \
46+
python3 -m venv env/; \
47+
source env/bin/activate; \
48+
pip3 install --upgrade pip;\
49+
pip install --no-cache-dir -r tests/python/integration/requirements.txt; \
50+
pytest tests/python/integration --alluredir=tests/allure_report || ret=$$?; exit $$ret \
51+
)
5452

5553
tests: unit-tests integration-tests
5654

5755
dist-clean:
58-
rm -rf dist
56+
rm -rf dist

0 commit comments

Comments
 (0)