forked from llr-cta/calin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
64 lines (59 loc) · 1.79 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
# calin/azure-pipelines.yaml -- Stephen Fegan -- 2018-11-13
#
# Build calin Docker images using Microsoft Azure compute platform and push
# them to the Docker hub.
#
# Copyright 2018, Stephen Fegan <[email protected]>
# Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris
#
# This file is part of "calin"
#
# "calin" is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 or later, as published by
# the Free Software Foundation.
#
# "calin" is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
trigger:
branches:
include:
- main
paths:
include:
- /
exclude:
- /travis.yml
- /singularity_build.def
- /.github/workflows/singularity-build-and-deploy.yml
- /.github/workflows/native-build-and-test.yml
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
generic:
build_arch: generic
ivybridge:
build_arch: ivybridge
broadwell:
build_arch: broadwell
cascadelake:
build_arch: cascadelake
variables:
imageName: 'calin:$(build_arch)'
latestImageName: 'calin:latest'
steps:
- script: |
docker build -f Dockerfile --build-arg arch=$(build_arch) -t $(dockerId)/$(imageName) .
displayName: 'Build Docker image'
- script: |
docker login -u $(dockerUser) -p $pswd
docker push $(dockerId)/$(imageName)
if test "$(build_arch)" == "generic"
then
docker tag $(dockerId)/$(imageName) $(dockerId)/$(latestImageName)
docker push $(dockerId)/$(latestImageName)
fi
env:
pswd: $(dockerPassword)
displayName: 'Push image to Docker hub'