Merge branch 'corm/cli-image' of https://github.com/Microsoft/Oryx into patch/cli-image

This commit is contained in:
cormacpayne 2019-11-13 09:55:32 -08:00
Родитель 299314f2ec 1e9066d519
Коммит 2369edbb85
2 изменённых файлов: 43 добавлений и 0 удалений

Просмотреть файл

@ -90,6 +90,18 @@ steps:
enforceDockerNamingConvention: true
condition: and(succeeded(), eq(variables['ReleaseBuildImages'], 'true'))
- task: Docker@1
displayName: 'Push CLI images to ACR'
inputs:
azureSubscriptionEndpoint: ${{ parameters.ascName }}
azureContainerRegistry: ${{ parameters.acrProdName }}
command: 'Push an image'
pushMultipleImages: true
imageNamesPath: '$(Build.ArtifactStagingDirectory)/drop/images/cli-images-mcr.txt'
includeLatestTag: false
enforceDockerNamingConvention: true
condition: and(succeeded(), eq(variables['ReleaseBuildImages'], 'true'))
- task: Docker@1
displayName: 'Push runtime images to ACR'
inputs:

Просмотреть файл

@ -0,0 +1,31 @@
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
# --------------------------------------------------------------------------------------------
set -o pipefail
declare -r REPO_DIR=$( cd $( dirname "$0" ) && cd .. && cd .. && pwd )
source $REPO_DIR/build/__variables.sh
declare -r outFile="$BUILD_ARTIFACTSTAGINGDIRECTORY/drop/images/cli-images-mcr.txt"
declare -r sourceImageRepo="oryxdevmcr.azurecr.io/public/oryx"
declare -r prodImageRepo="oryxmcr.azurecr.io/public/oryx"
sourceBranchName=$BUILD_SOURCEBRANCHNAME
cliImage="$sourceImageRepo/cli:Oryx-CI.$RELEASE_TAG_NAME"
echo "Pulling CLI image '$cliImage'..."
docker pull "$cliImage"
echo "Retagging CLI image with '$RELEASE_TAG_NAME'..."
echo "$prodImageRepo/cli:$RELEASE_TAG_NAME">>"$outFile"
docker tag "$cliImage" "$prodImageRepo/cli:$RELEASE_TAG_NAME"
if [ "$sourceBranchName" == "master" ]; then
echo "Retagging CLI image with 'stable'..."
docker tag "$cliImage" "$prodImageRepo/cli:stable"
echo "$prodImageRepo/cli:stable">>"$outFile"
else
echo "Not creating 'stable' or 'latest' tags as source branch is not 'master'. Current branch is $sourceBranchName"
fi