-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
77 lines (68 loc) · 2.45 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Python Django
# Test a Django project on multiple versions of Python.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
variables:
- name: tf_version
value: 0.14.2
trigger:
- development
- feature/*
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python36:
PYTHON_VERSION: '3.6'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
architecture: 'x64'
- task: PythonScript@0
displayName: 'Export project path'
inputs:
scriptSource: 'inline'
script: |
"""Search all subdirectories for `manage.py`."""
from glob import iglob
from os import path
# Python >= 3.5
manage_py = next(iglob(path.join('**', 'manage.py'), recursive=True), None)
if not manage_py:
raise SystemExit('Could not find a Django project')
project_location = path.dirname(path.abspath(manage_py))
print('Found Django project in', project_location)
print('##vso[task.setvariable variable=projectRoot]{}'.format(project_location))
# - script: |
# echo $(tfc-api)
# python -m pip install --upgrade pip setuptools wheel
# pip install -r requirements.txt
# pip install unittest-xml-reporting pycodestyle
# sudo systemctl stop postgresql
# sudo apt-get --purge remove postgresql*
# sudo rm -rf /etc/postgresql-common /var/log/postgresql /var/lib/postgresql /etc/postgresql
# curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
# sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
# sudo apt-get update
# sudo apt-get install -y postgresql-9.6 redis-server awscli terraform=${{ variables.tf_version }}
# sudo -u postgres psql -U postgres -c "alter user postgres with password 'test';"
# displayName: 'Install prerequisites'
# - script: |
# PGPASSWORD='test' psql -h localhost -U postgres -c 'SELECT version();'
# redis-cli ping
# displayName: 'Test service dependencies'
# - script: |
# ./scripts/cibuild.sh
# displayName: 'Run tests'
- task: GitHubRelease@1
displayName: 'Create Release'
inputs:
gitHubConnection: 'GitHub - kpsc-automation'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
tagPattern: 'v*.*.*'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'