tacticalrmm/azure-pipelines.yml

66 lines
2.4 KiB
YAML
Raw Normal View History

2019-12-30 21:32:07 +00:00
trigger:
2020-05-08 05:37:45 +00:00
- master
- develop
2019-12-30 21:32:07 +00:00
jobs:
2020-05-08 05:37:45 +00:00
- job: setup_env
2020-09-25 02:10:19 +00:00
displayName: "Setup"
2020-05-08 05:37:45 +00:00
strategy:
matrix:
2021-01-31 02:42:10 +00:00
Debian10:
2021-08-21 15:26:25 +00:00
AGENT_NAME: "az-pipeline-fran"
2020-05-08 05:37:45 +00:00
pool:
name: linux-vms
demands:
- agent.name -equals $(AGENT_NAME)
steps:
- script: |
2020-09-25 02:41:53 +00:00
sudo -u postgres psql -c 'DROP DATABASE IF EXISTS pipeline'
sudo -u postgres psql -c 'DROP DATABASE IF EXISTS test_pipeline'
sudo -u postgres psql -c 'CREATE DATABASE pipeline'
2021-08-20 08:23:16 +00:00
sudo -u postgres psql -c "SET client_encoding = 'UTF8'" pipeline
2021-06-22 06:47:17 +00:00
SETTINGS_FILE="/myagent/_work/1/s/api/tacticalrmm/tacticalrmm/settings.py"
2020-09-25 02:10:19 +00:00
rm -rf /myagent/_work/1/s/api/env
cd /myagent/_work/1/s/api
2021-02-21 07:37:19 +00:00
python3.9 -m venv env
2020-05-08 05:37:45 +00:00
source env/bin/activate
2020-09-25 02:10:19 +00:00
cd /myagent/_work/1/s/api/tacticalrmm
2021-06-22 06:51:44 +00:00
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --upgrade pip
2021-06-22 06:47:17 +00:00
SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')
WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}')
2021-06-22 06:51:44 +00:00
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org setuptools==${SETUPTOOLS_VER} wheel==${WHEEL_VER}
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt -r requirements-test.txt -r requirements-dev.txt
2020-05-08 05:37:45 +00:00
displayName: "Install Python Dependencies"
- script: |
2020-09-25 02:10:19 +00:00
cd /myagent/_work/1/s/api
2020-05-08 05:37:45 +00:00
source env/bin/activate
2020-09-25 02:13:40 +00:00
cd /myagent/_work/1/s/api/tacticalrmm
2020-12-04 06:40:44 +00:00
coverage run manage.py test -v 2
2020-12-16 09:25:28 +00:00
if [ $? -ne 0 ]; then
exit 1
fi
2020-05-08 05:37:45 +00:00
displayName: "Run django tests"
2020-12-16 10:38:00 +00:00
2020-12-19 08:24:47 +00:00
- script: |
cd /myagent/_work/1/s/api
source env/bin/activate
2021-02-03 20:11:49 +00:00
black --exclude migrations/ --check tacticalrmm
2020-12-19 08:24:47 +00:00
if [ $? -ne 0 ]; then
exit 1
fi
displayName: "Codestyle black"
2020-12-16 10:38:00 +00:00
- script: |
2020-12-16 10:41:39 +00:00
cd /myagent/_work/1/s/api
source env/bin/activate
cd /myagent/_work/1/s/api/tacticalrmm
2020-12-16 10:38:00 +00:00
export CIRCLE_BRANCH=$BUILD_SOURCEBRANCH
coveralls
displayName: "coveralls"
env:
CIRCLECI: 1
CIRCLE_BUILD_NUM: $(Build.BuildNumber)