зеркало из https://github.com/Azure/ARO-RP.git
51 строка
1.4 KiB
YAML
51 строка
1.4 KiB
YAML
pr: none
|
|
trigger: none
|
|
|
|
resources:
|
|
pipelines:
|
|
- pipeline: mirror
|
|
source: Build and Push RP image tagged
|
|
trigger: true
|
|
|
|
variables:
|
|
- group: INT CI Credentials
|
|
- name: rpIntImageAcr
|
|
value: arointsvc
|
|
- name: rpProdImageAcr
|
|
value: arosvc
|
|
|
|
jobs:
|
|
- job: Mirror_ARO_to_INT
|
|
displayName: ➜ Mirror ARO to INT
|
|
condition: startsWith(variables['build.sourceBranch'], 'refs/tags/v2')
|
|
pool:
|
|
name: ARO-CI
|
|
demands: go-1.17
|
|
|
|
steps:
|
|
- template: ./templates/template-checkout.yml
|
|
- template: ./templates/template-az-cli-login.yml
|
|
parameters:
|
|
azureDevOpsJSONSPN: $(aro-v4-ci-devops-spn)
|
|
- script: |
|
|
# read current annotated tag that started this pipeline
|
|
TAG=$(git describe --exact-match)
|
|
|
|
# there is no this pipeline ends with error
|
|
[[ -z ${TAG} ]] && exit 1
|
|
|
|
## set the variable
|
|
echo "##vso[task.setvariable variable=TAG]${TAG}"
|
|
- script: |
|
|
USERNAME=`echo "$(aro-v4-ci-pd-pull)" | base64 -d | cut -d':' -f1`
|
|
PASSWORD=`echo "$(aro-v4-ci-pd-pull)" | base64 -d | cut -d':' -f2-`
|
|
|
|
az acr login --name "${{variables.rpIntImageAcr}}"
|
|
az acr import \
|
|
--force \
|
|
--name "${{variables.rpIntImageAcr}}" \
|
|
--source "${{variables.rpProdImageAcr}}.azurecr.io/aro:${TAG}" \
|
|
--username "$USERNAME" \
|
|
--password "$PASSWORD"
|
|
- template: ./templates/template-az-cli-logout.yml
|