From a17c5bf6642345c6bf555666d8a1702cb3fcafb1 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Fri, 24 Apr 2020 14:17:07 +0900 Subject: [PATCH] Set up CI with Azure Pipelines [skip ci] --- .ci/azure-pipelines/daily-slot.yml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .ci/azure-pipelines/daily-slot.yml diff --git a/.ci/azure-pipelines/daily-slot.yml b/.ci/azure-pipelines/daily-slot.yml new file mode 100644 index 0000000..fd60ebf --- /dev/null +++ b/.ci/azure-pipelines/daily-slot.yml @@ -0,0 +1,37 @@ +# This is not a CI, just a CD +trigger: none +pr: none + +pool: + vmImage: 'ubuntu-latest' +strategy: + matrix: + Python37: + python.version: '3.7' + +schedules: +- cron: "0 0 * * *" + displayName: "Everyday midnight trigger" + branches: + include: + - master + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' +- task: DownloadSecureFile@1 + name: "discord_config" + displayName: 'Download login tokens for the bot' + inputs: + secureFile: 'config.json' + +- script: | + python main.py --channel_id $(Channel ID) --config $(discord_config.secureFilePath) + displayName: 'Run trigger'