ci: migrate lint to az
This commit is contained in:
parent
df33616544
commit
cfc8d0a0f7
|
@ -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##*/}/"
|
|
|
@ -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: pylint
|
||||||
- job: Build
|
pool:
|
||||||
displayName: Build
|
vmImage: 'ubuntu-latest'
|
||||||
pool:
|
steps:
|
||||||
vmImage: 'ubuntu-latest'
|
- task: UsePythonVersion@0
|
||||||
steps:
|
inputs:
|
||||||
- task: Docker@2
|
versionSpec: '3.8'
|
||||||
displayName: Build an image
|
- task: CmdLine@2
|
||||||
inputs:
|
inputs:
|
||||||
command: build
|
script: |
|
||||||
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
|
sudo pip install -U wheel pipenv
|
||||||
tags: |
|
pipenv install --dev
|
||||||
$(tag)
|
- 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
|
||||||
|
|
Reference in New Issue