forked from eclipse-che/che-devfile-registry
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
78 lines (68 loc) · 2.49 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
67
68
69
70
71
72
73
74
75
76
77
78
---
# Docker image
# Build a Docker image to deploy, run, or push to a container registry.
# Add steps that use Docker Compose, tag images, push to a registry, run an image, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- pizzafactory
schedules:
- cron: "20 12 * * *"
displayName: Daily build
branches:
include:
- pizzafactory
always: true
variables:
containerRegistry: camino.azurecr.io
organization: camino
imageTag: next
jobs:
- job: build
pool:
vmImage: 'Ubuntu-latest'
steps:
- script: |
BUILDER=docker ./build.sh -r $(containerRegistry) -o $(organization) -t $(imageTag) --offline
displayName: 'docker build'
- task: Docker@1
inputs:
command: login
containerregistrytype: Container Registry
dockerRegistryEndpoint: camino.azurecr.io
- script: |
docker push $(containerRegistry)/$(organization)/che-devfile-registry:$(imageTag)
displayName: 'push to ACR'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/pizzafactory'))
- job: build_image
dependsOn:
- build
condition: and(succeeded('build'), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/pizzafactory'))
timeoutInMinutes: 120
pool:
vmImage: 'Ubuntu-latest'
steps:
- task: Docker@1
inputs:
command: login
containerregistrytype: Container Registry
dockerRegistryEndpoint: camino.azurecr.io
- script: dockerfiles/build.sh --all --push
displayName: 'Build and push patched images.'
env:
REGISTRY: 'camino.azurecr.io'
ORGANIZATION: 'camino'
- job: import
dependsOn:
- build
condition: and(succeeded('build'), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/pizzafactory'))
timeoutInMinutes: 120
pool:
vmImage: 'Ubuntu-latest'
steps:
- task: AzureCLI@2
displayName: 'Imports images'
inputs:
azureSubscription: 'camino: BizSpark (1fbdb4bb-441e-4922-ba1f-ffd04f533ea1)'
scriptType: bash
scriptLocation: inlineScript
inlineScript: 'git grep '' image:'' devfiles | awk ''!/camino.azurecr.io|quay.io\/eclipse/ { print $NF }'' | sort | uniq | awk ''{print "az acr import --force --name camino --source " $0 }''| sh -x'