From cfc8d0a0f746f0a4bbcb1deb41518825f2b94210 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 28 May 2020 19:15:18 +0200 Subject: [PATCH] ci: migrate lint to az --- .github/workflows/ci-cleanup.yml | 38 ----------- azure-pipelines.yml | 109 ++++++++++++++++++++++++------- 2 files changed, 87 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/ci-cleanup.yml diff --git a/.github/workflows/ci-cleanup.yml b/.github/workflows/ci-cleanup.yml deleted file mode 100644 index 0d24155b0..000000000 --- a/.github/workflows/ci-cleanup.yml +++ /dev/null @@ -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##*/}/" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 03fa44f81..dc01bfb97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,29 +1,94 @@ -# Docker -# Build a Docker image -# https://docs.microsoft.com/azure/devops/pipelines/languages/docker - trigger: -- master + - master resources: -- repo: self + - repo: self variables: - tag: '$(Build.BuildId)' + POSTGRES_DB: passbook + POSTGRES_USER: passbook + POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77" stages: -- stage: Build - displayName: Build image - jobs: - - job: Build - displayName: Build - pool: - vmImage: 'ubuntu-latest' - steps: - - task: Docker@2 - displayName: Build an image - inputs: - command: build - dockerfile: '$(Build.SourcesDirectory)/Dockerfile' - tags: | - $(tag) \ No newline at end of file + - 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: + 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