2020-05-28 16:57:48 +00:00
|
|
|
trigger:
|
2020-05-28 17:15:18 +00:00
|
|
|
- master
|
2020-05-28 16:57:48 +00:00
|
|
|
|
|
|
|
resources:
|
2020-05-28 17:15:18 +00:00
|
|
|
- repo: self
|
2020-05-28 16:57:48 +00:00
|
|
|
|
|
|
|
variables:
|
2020-05-28 17:15:18 +00:00
|
|
|
POSTGRES_DB: passbook
|
|
|
|
POSTGRES_USER: passbook
|
|
|
|
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
|
2020-05-28 16:57:48 +00:00
|
|
|
|
|
|
|
stages:
|
2020-05-28 17:15:18 +00:00
|
|
|
- stage: Lint
|
|
|
|
jobs:
|
|
|
|
- job: pylint
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run pylint passbook
|
|
|
|
- job: black
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run black --check passbook
|
|
|
|
- job: prospector
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
pipenv install --dev prospector --skip-lock
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
2020-05-28 17:29:28 +00:00
|
|
|
script: pipenv run prospector passbook
|
2020-05-28 17:15:18 +00:00
|
|
|
- job: bandit
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run bandit -r passbook
|
|
|
|
- job: pyright
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- task: UseNode@1
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: npm install -g pyright
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run pyright
|
2020-05-28 17:29:28 +00:00
|
|
|
- stage: Test
|
|
|
|
jobs:
|
|
|
|
- job: migrations
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: DockerCompose@0
|
|
|
|
displayName: Run services
|
|
|
|
inputs:
|
|
|
|
dockerComposeFile: 'scripts/docker-compose.yml'
|
|
|
|
action: 'Run services'
|
|
|
|
buildImages: false
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run ./manage.py migrate
|
|
|
|
- job: coverage
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '3.8'
|
|
|
|
- task: DockerCompose@0
|
|
|
|
displayName: Run services
|
|
|
|
inputs:
|
|
|
|
dockerComposeFile: 'scripts/docker-compose.yml'
|
|
|
|
action: 'Run services'
|
|
|
|
buildImages: false
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
sudo pip install -U wheel pipenv
|
|
|
|
pipenv install --dev
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run ./scripts/coverage.sh
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: pipenv run coverage xml
|
|
|
|
- task: CmdLine@2
|
2020-05-29 07:18:17 +00:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: $(CODECOV_TOKEN)
|
2020-05-28 17:29:28 +00:00
|
|
|
inputs:
|
|
|
|
script: bash <(curl -s https://codecov.io/bash)
|
2020-05-28 17:44:25 +00:00
|
|
|
- stage: Build
|
|
|
|
jobs:
|
2020-05-28 17:46:10 +00:00
|
|
|
- job: build_server
|
2020-05-28 17:44:25 +00:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
2020-05-28 19:00:30 +00:00
|
|
|
steps:
|
|
|
|
- task: Docker@2
|
|
|
|
inputs:
|
|
|
|
containerRegistry: 'dockerhub'
|
|
|
|
repository: 'beryju/passbook'
|
|
|
|
command: 'buildAndPush'
|
|
|
|
Dockerfile: 'Dockerfile'
|
|
|
|
tags: '$(Build.SourceBranchName)'
|
2020-05-28 17:46:10 +00:00
|
|
|
- job: build_gatekeeper
|
2020-05-28 17:44:25 +00:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
2020-05-28 19:00:30 +00:00
|
|
|
steps:
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: cd gatekeeper
|
|
|
|
- task: Docker@2
|
|
|
|
inputs:
|
|
|
|
containerRegistry: 'dockerhub'
|
|
|
|
repository: 'beryju/passbook-gatekeeper'
|
|
|
|
command: 'buildAndPush'
|
|
|
|
Dockerfile: 'Dockerfile'
|
|
|
|
tags: '$(Build.SourceBranchName)'
|
2020-05-28 17:46:10 +00:00
|
|
|
- job: build_static
|
2020-05-28 17:44:25 +00:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
2020-05-28 19:00:30 +00:00
|
|
|
steps:
|
|
|
|
- task: DockerCompose@0
|
|
|
|
displayName: Run services
|
|
|
|
inputs:
|
|
|
|
dockerComposeFile: 'scripts/docker-compose.yml'
|
|
|
|
action: 'Run services'
|
|
|
|
buildImages: false
|
|
|
|
- task: Docker@2
|
|
|
|
inputs:
|
|
|
|
containerRegistry: 'dockerhub'
|
|
|
|
repository: 'beryju/passbook-static'
|
2020-05-29 07:43:00 +00:00
|
|
|
command: 'build'
|
2020-05-28 19:19:06 +00:00
|
|
|
Dockerfile: 'static.Dockerfile'
|
2020-05-28 19:00:30 +00:00
|
|
|
tags: '$(Build.SourceBranchName)'
|
2020-05-29 08:04:23 +00:00
|
|
|
arguments: "--network=beryjupassbook_default"
|
2020-05-29 07:43:00 +00:00
|
|
|
- task: Docker@2
|
|
|
|
inputs:
|
|
|
|
containerRegistry: 'dockerhub'
|
|
|
|
repository: 'beryju/passbook-static'
|
|
|
|
command: 'push'
|
|
|
|
tags: '$(Build.SourceBranchName)'
|