-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
60 lines (58 loc) · 1.62 KB
/
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
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
branches:
include:
- master
paths:
include:
- mlflow-image/mlflow_version
- infrastructure
resources:
- repo: self
stages:
- stage: Build
displayName: Build image
jobs:
- job: Image
displayName: Image
pool:
vmImage: ubuntu-latest
steps:
- bash: |
MLFLOW_VERSION=$(cat ./mlflow-image/mlflow_version)
echo $MLFLOW_VERSION
echo "##vso[task.setvariable variable=tag;isOutput=true]$MLFLOW_VERSION"
name: mlflow_version
- task: Docker@2
displayName: Build an image
inputs:
command: 'build'
Dockerfile: './mlflow-image/Dockerfile'
arguments: '-t mlflow:$(mlflow_version.tag)'
- task: ECRPushImage@1
inputs:
awsCredentials: 'ECR Push'
regionName: 'eu-central-1'
imageSource: 'imagename'
sourceImageName: 'mlflow'
sourceImageTag: '$(mlflow_version.tag)'
repositoryName: 'dna/mlflow'
pushTag: '$(mlflow_version.tag)'
displayName: "Push mlflow image"
- task: AWSShellScript@1
displayName: Create TF plan
inputs:
awsCredentials: 'AWS mlops'
regionName: 'eu-central-1'
scriptType: 'inline'
inlineScript: |
terraform init
terraform plan --out plan.tfplan
terraform apply -auto-approve plan.tfplan
disableAutoCwd: true
workingDirectory: '$(System.DefaultWorkingDirectory)/infrastructure'
failOnStandardError: true
- publish: 'infrastructure'
artifact: 'tf'