Fix cross-comp CI pipeline (ARM & MIPS32) to build against target branch instead of main (#2509)

The ARM and the MIPS32 cross-compilation jobs in .vsts-ci.yml will always target the main branch,
ignoring the branch a given PR is based on and letting potential issues sip through.
This change fixes the ARM and MIPS32 jobs so they run against whatever branch the pipeline is running
against.
This commit is contained in:
Ewerton Scaboro da Silva 2023-07-25 13:09:40 -07:00 коммит произвёл GitHub
Родитель 979d0718d2
Коммит f14ea559b8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 8 добавлений и 2 удалений

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

@ -959,7 +959,7 @@ jobs:
displayName: 'Setup'
- script: |
cd samples/dockerbuilds/MIPS32
docker build -t mipsiotbuild:latest . --network=host
docker build --build-arg TARGET_BRANCH=$BUILD_SOURCEBRANCH -t mipsiotbuild:latest . --network=host
cd ..
docker build -t mipsiotapp:latest . --network=host --file ./MIPS32/Dockerfile_adjunct
displayName: 'Build MIPS32'
@ -981,7 +981,7 @@ jobs:
displayName: 'Setup'
- script: |
cd samples/dockerbuilds/ARM
docker build -t armiotbuild:latest . --network=host
docker build --build-arg TARGET_BRANCH=$BUILD_SOURCEBRANCH -t armiotbuild:latest . --network=host
cd ..
docker build -t armiotapp:latest . --network=host --file ./ARM/Dockerfile_adjunct
displayName: 'Build ARM'

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

@ -1,5 +1,6 @@
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
ARG TARGET_BRANCH=main
#########################################
# start from home directory
@ -74,6 +75,8 @@ WORKDIR ..
# Build Azure C SDK
RUN git clone https://github.com/azure/azure-iot-sdk-c.git
WORKDIR azure-iot-sdk-c
RUN git fetch origin $TARGET_BRANCH
RUN git checkout FETCH_HEAD
RUN git submodule update --init
RUN mkdir cmake
WORKDIR cmake

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

@ -1,4 +1,5 @@
FROM ubuntu:latest
ARG TARGET_BRANCH=main
#########################################
# start from home directory
@ -80,6 +81,8 @@ WORKDIR ..
RUN git clone https://github.com/azure/azure-iot-sdk-c.git
WORKDIR azure-iot-sdk-c
RUN git fetch origin $TARGET_BRANCH
RUN git checkout FETCH_HEAD
RUN git submodule update --init
RUN mkdir cmake
WORKDIR cmake