-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathazure-pipelines.yml
57 lines (51 loc) · 1.29 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
# The pipeline builds the docker image, tags it as 'latest' and pushes it to the Docker Hub
variables:
- group: AzureKeyVault
- name: repository
value: griffinplus/zimbra
- name: image_tag
value: latest
- name: registry_user
value: $(dockerhub-user)
- name: registry_password
value: $(dockerhub-password)
trigger:
- master
# do not trigger on pull requests to avoid that tag 'latest' is pushed for pull requests
pr: none
schedules:
- cron: "0 0 * * 0"
displayName: Weekly Sunday Rebuild
branches:
include:
- master
always: true
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Login
inputs:
command: login
containerregistry: Docker Hub
- task: Docker@2
displayName: Build and Push
inputs:
command: buildAndPush
Dockerfile: Dockerfile
repository: $(repository)
tags: $(image_tag)
- script: |
docker run \
-v $PWD:/workspace \
-e DOCKERHUB_USERNAME='$(registry_user)' \
-e DOCKERHUB_PASSWORD='$(registry_password)' \
-e DOCKERHUB_REPOSITORY='$(repository)' \
-e README_FILEPATH='/workspace/README.md' \
griffinplus/dockerhub-description
displayName: Update Image Description
- task: Docker@2
displayName: Logout
inputs:
command: logout
containerRegistry: Docker Hub