-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathpublish-dotnet-8.yml
66 lines (56 loc) · 2.79 KB
/
publish-dotnet-8.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
trigger: none
# Publish pipelines are triggered via HTTP method in release pipeline. See v4 publish
schedules:
- cron: "0 3 * * *"
displayName: 3 AM Nightly Publish
branches:
include:
- nightly-build
always: true
pool:
vmImage: 'Ubuntu-latest'
steps:
- bash: |
echo $pswd | docker login -u $(dockerUsername) --password-stdin azurefunctions.azurecr.io
displayName: login
continueOnError: false
env:
pswd: $(dockerPassword)
- bash: |
echo "##vso[task.setvariable variable=PrivateVersion;]nightly-build"
echo "##vso[task.setvariable variable=TargetVersion;]4-nightly"
displayName: Set Nightly Build Variables
continueOnError: false
condition: eq(variables['Build.Reason'], 'Schedule')
- bash: |
set -e
SOURCE_REGISTRY=azurefunctions.azurecr.io/azure-functions/4
TARGET_REGISTRY=azurefunctions.azurecr.io/public/azure-functions
if [ -z "$(TargetVersion)" ]; then
echo "ERROR: TargetVersion is required"
exit 1
fi
if [ -z "$(PrivateVersion)" ]; then
echo "ERROR: PrivateVersion is required"
exit 1
fi
echo "##vso[task.setvariable variable=SOURCE_REGISTRY]$SOURCE_REGISTRY"
echo "##vso[task.setvariable variable=TARGET_REGISTRY]$TARGET_REGISTRY"
displayName: set env
continueOnError: false
- bash: |
set -e
docker pull $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0
docker pull $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-slim
docker pull $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-appservice
docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0 $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0
docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-slim $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-slim
docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-appservice $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-appservice
docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-appservice $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-appservice-quickstart
docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0
docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-slim
docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-appservice
docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-appservice-quickstart
docker system prune -a -f
displayName: tag and push dotnet8-isolated images
continueOnError: false