зеркало из https://github.com/microsoft/CCF.git
Fix synchronising github and azure pipelines by SHA (#4768)
Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
This commit is contained in:
Родитель
68881c5e7e
Коммит
741d74eb14
|
@ -16,10 +16,15 @@ jobs:
|
|||
- script: |
|
||||
set -ex
|
||||
RETRIES=500
|
||||
LAST_COMMIT=(`git log -1 --pretty=%B`)
|
||||
GIT_SHA=${LAST_COMMIT[1]}
|
||||
echo "##vso[task.setvariable variable=gitSha;isOutput=true]$GIT_SHA"
|
||||
until [ $RETRIES -eq 0 ] || [[ `az acr repository show-tags -n ccfmsrc --repository ccf/ci` == *"$GIT_SHA"* ]]
|
||||
HEAD_SHA=`git rev-parse HEAD`
|
||||
if [ -n $(System.PullRequest.PullRequestId) ]; then
|
||||
# If this is the case, we're running in a PR, and the SHA we really want is in the
|
||||
# commit message of the last commit (which merges it into target)
|
||||
LAST_COMMIT=(`git log -1 --pretty=%B`)
|
||||
HEAD_SHA=${LAST_COMMIT[1]}
|
||||
fi
|
||||
echo "##vso[task.setvariable variable=gitSha;isOutput=true]$HEAD_SHA"
|
||||
until [ $RETRIES -eq 0 ] || [[ `az acr repository show-tags -n ccfmsrc --repository ccf/ci` == *"$HEAD_SHA"* ]]
|
||||
do
|
||||
sleep 10
|
||||
echo "$(( RETRIES-- )) tries remaining"
|
||||
|
|
|
@ -44,7 +44,7 @@ jobs:
|
|||
run: docker pull $ACR_REGISTRY/ccf/ci:oe-0.18.4-hspec-snp
|
||||
|
||||
- name: Build CCF CI SNP container
|
||||
run: docker build -f docker/ccf_ci_built . --build-arg="base=ccfmsrc.azurecr.io/ccf/ci:oe-0.18.4-hspec" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-${{ github.event.pull_request.head.sha }}
|
||||
run: docker build -f docker/ccf_ci_built . --build-arg="base=ccfmsrc.azurecr.io/ccf/ci:oe-0.18.4-hspec" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
|
||||
|
||||
- name: Push CI container
|
||||
run: docker push $ACR_REGISTRY/ccf/ci:pr-${{ github.event.pull_request.head.sha }}
|
||||
run: docker push $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
|
||||
|
|
Загрузка…
Ссылка в новой задаче