forked from python-discord/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
57 lines (43 loc) · 1.27 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
# https://aka.ms/yaml
variables:
PIPENV_HIDE_EMOJIS: 1
PIPENV_IGNORE_VIRTUALENVS: 1
PIPENV_NOSPIN: 1
jobs:
- job: test
displayName: 'Lint & Test'
pool:
vmImage: 'Ubuntu 16.04'
variables:
PIPENV_CACHE_DIR: ".cache/pipenv"
PIP_CACHE_DIR: ".cache/pip"
PIP_SRC: ".cache/src"
steps:
- script: sudo apt-get install build-essential curl docker libffi-dev libfreetype6-dev libxml2 libxml2-dev libxslt1-dev zlib1g zlib1g-dev
displayName: 'Install base dependencies'
- task: UsePythonVersion@0
displayName: 'Set Python version'
inputs:
versionSpec: '3.7.x'
addToPath: true
- script: sudo pip install pipenv
displayName: 'Install pipenv'
- script: pipenv install --dev --deploy --system
displayName: 'Install project using pipenv'
- script: python -m flake8
displayName: 'Run linter'
- job: build
displayName: 'Build Containers'
dependsOn: 'test'
steps:
- task: Docker@1
displayName: 'Login: Docker Hub'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'DockerHub'
command: 'login'
- task: ShellScript@2
displayName: 'Build and deploy containers'
inputs:
scriptPath: scripts/deploy-azure.sh
args: '$(AUTODEPLOY_TOKEN) $(AUTODEPLOY_WEBHOOK)'