This repository has been archived by the owner on May 23, 2024. It is now read-only.
forked from hellofresh/eks-rolling-update
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
66 lines (56 loc) · 1.68 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
61
62
63
64
65
66
pr: none
trigger:
branches:
include: ['*']
tags:
include: ['v*.*.*']
variables:
- group: global-variables
resources:
repositories:
- repository: templates
type: github
endpoint: mx51
name: mx51/azure-cicd-templates
ref: refs/heads/master
stages:
# Build and Release stage
- stage: build_and_release
jobs:
- job: Build
pool: shared
steps:
- script: make setup
displayName: "Create venv and install packages"
- script: |
VERSION=$( ./determine-version.sh )
echo make docker-dist version=$VERSION
make docker-dist version=$VERSION
displayName: "Build docker image"
- template: partials/sysdig-scan.yml@templates
parameters:
sysdigUrl: $(SYSDIG_URL)
sysdigKey: $(SYSDIG_KEY)
sysdigProjectEnvFile: ".env"
sysdigPlatformTag: ""
sysdigScanDebugImage: false
sysdigFailBuild: true
sysdigVerboseLogging: false
- ${{ if startsWith(variables['build.sourceBranch'], 'refs/tags/v') }}:
- script: |
$( awsume-role.sh )
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
env:
AWS_ROLE_ARN: $(ASSUMED_ROLE)
EXPORT: true
displayName: "Perform docker login"
- script: |
source .env
VERSION=$( ./determine-version.sh )
echo docker push $IMAGE_NMAE:$VERSION
docker push $IMAGE_NAME:$VERSION
docker push $IMAGE_NAME:latest
displayName: "Release docker image"
- script: docker logout public.ecr.aws
condition: always()
displayName: "Perform docker logout"