-
Notifications
You must be signed in to change notification settings - Fork 3
/
example_azure_pipelines.yml
76 lines (68 loc) · 2.18 KB
/
example_azure_pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
branches:
include:
- main
paths:
exclude:
- highestIDs/*
- processed/*
- apple_stats/*
- twilio-replies/*
- azure-pipelines.yml
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
#- script: |
# pwd
# python -m pip install --upgrade pip
# pip install pipenv
# pipenv install
# displayName: 'Install dependencies + pipenv virtual environment'
- task: DockerInstaller@0
inputs:
dockerVersion: '17.09.0-ce'
- script: |
cd encv
pip install poetry
sed -i "12i \ \ \ \ Default: \"$(ENCVAPIKEY)\"" template.yaml
displayName: 'Install poetry & inject encvapikey to sam template'
- task: AWSShellScript@1
inputs:
awsCredentials: 'cdphe-covidpython-t'
regionName: 'us-east-1'
arguments: ''
scriptType: 'inline'
inlineScript: |
cd encv
echo "run make - performing sam build..."
make clean
make build
echo "performing sam package..."
cat .aws-sam/build.toml >> sam.toml
sam package --config-file sam.toml --s3-bucket YOUR_S3_BUCKET_NAME --force-upload --template-file .aws-sam/build/template.yaml --region us-east-1 --output-template-file my_output_template.yaml
mkdir release
cp sam.toml buildspec.yml cdphe-covidpython-t-release.yaml release
displayName: 'perform sam package for test'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/release'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sam_$(artifactname).zip'
replaceExistingArchive: true
displayName: 'package toml and yml files for deployment'
- publish: $(Build.ArtifactStagingDirectory)/sam_$(artifactname).zip
displayName: 'Create Artifact'
artifact: sam_$(artifactname)