ci: migrate lint to az

This commit is contained in:
Jens Langhammer 2020-05-28 19:15:18 +02:00
parent df33616544
commit cfc8d0a0f7
2 changed files with 87 additions and 60 deletions

View File

@ -1,38 +0,0 @@
name: passbook-ci-cleanup
on:
- delete
jobs:
delete-server:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook/tags/${GITHUB_REF##*/}/"
delete-gatekeeper:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook-gatekeeper/tags/${GITHUB_REF##*/}/"
delete-static:
runs-on: ubuntu-latest
steps:
- name: Delete docker tag
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: curl
-u $DOCKER_USERNAME:$DOCKER_PASSWORD
-X "DELETE"
"https://hub.docker.com/v2/repositories/$DOCKER_USERNAME/passbook-static/tags/${GITHUB_REF##*/}/"

View File

@ -1,29 +1,94 @@
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger: trigger:
- master - master
resources: resources:
- repo: self - repo: self
variables: variables:
tag: '$(Build.BuildId)' POSTGRES_DB: passbook
POSTGRES_USER: passbook
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
stages: stages:
- stage: Build - stage: Lint
displayName: Build image
jobs: jobs:
- job: Build - job: pylint
displayName: Build
pool: pool:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
steps: steps:
- task: Docker@2 - task: UsePythonVersion@0
displayName: Build an image
inputs: inputs:
command: build versionSpec: '3.8'
dockerfile: '$(Build.SourcesDirectory)/Dockerfile' - task: CmdLine@2
tags: | inputs:
$(tag) 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:
script: pipenv run prospector --check passbook
- 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