代码拉取完成,页面将自动刷新
stages:
- .pre
- ade
- build
- test
- deploy
.ade_base:
variables:
DOCKER_DRIVER: overlay2
ROS_DISTRO: foxy
UBUNTU_DISTRO: focal
stage: ade
image: docker
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- apk add --update-cache git
- mv ros-deps tools/ade_image
- cp autoware.auto.foxy.repos tools/ade_image
- cd tools/ade_image
- export ADE_SHA=$(find . -type f | sort | xargs sha256sum | sha256sum | rev | cut -c 4- | rev)
- '
if [[ -n "$FORCE" ]]; then
chmod og-w . -R;
docker build
--build-arg ROS_DISTRO=${ROS_DISTRO}
--build-arg CODENAME=${UBUNTU_DISTRO}
--label ade_image_commit_sha="$CI_COMMIT_SHA"
--label ade_image_commit_tag="$CI_COMMIT_TAG"
-t image .;
else
(
docker pull $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:change-$ADE_SHA &&
docker tag $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:change-$ADE_SHA image
) || (
chmod og-w . -R;
docker build
--build-arg ROS_DISTRO=${ROS_DISTRO}
--build-arg CODENAME=${UBUNTU_DISTRO}
--label ade_image_commit_sha="$CI_COMMIT_SHA"
--label ade_image_commit_tag="$CI_COMMIT_TAG"
-t image .;
);
fi
'
- docker tag image $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:change-$ADE_SHA
- docker tag image $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:commit-$CI_COMMIT_SHA
- docker tag image $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:change-$ADE_SHA
- docker push $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:commit-$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:$CI_COMMIT_REF_NAME
after_script:
- docker container prune -f
- docker image prune -a -f
needs:
- gen_ros_deps_foxy
.build_base:
variables:
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
ROS_DISTRO: foxy
stage: build
image: $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:commit-$CI_COMMIT_SHA
script:
- 'apt-get update && apt-get -y --no-install-recommends install
clang-tidy
git
git-lfs
'
- 'git lfs install'
- 'git lfs pull --include="*" --exclude=""'
- 'vcs import < autoware.auto.$ROS_DISTRO.repos'
# build and test
- 'colcon build
--merge-install
--install-base /opt/AutowareAuto
--cmake-args -DCMAKE_BUILD_TYPE=Release
'
- chmod -R og-w /opt/AutowareAuto
- tar czf opt.tar.gz /opt/AutowareAuto
- grep -h -r -o -P "(?<=\<name\>).*(?=\<\/name\>)" $(find src/external -name package.xml) | sort >> external_deps.txt
artifacts:
name: "$CI_JOB_NAME"
paths:
- build/
- external_deps.txt
- opt.tar.gz
.gen_deps_base:
stage: .pre
script:
- apt-get update && apt-get install -y python3-vcstool python3-pip
- vcs import < autoware.auto.$ROS_DISTRO.repos
- rosdep update
- rosdep install --as-root "apt:false pip:false" --simulate --reinstall --ignore-src -y --from-paths src | sort >> ros-deps
artifacts:
name: "$CI_JOB_NAME"
paths:
- ros-deps
.test_base:
variables:
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
ROS_DISTRO: foxy
stage: test
image: $CI_REGISTRY_IMAGE/$ARCH/ade-$ROS_DISTRO:commit-$CI_COMMIT_SHA
script:
- tar xzf opt.tar.gz -C /
- rm opt.tar.gz
- source /opt/AutowareAuto/setup.bash
- 'colcon test
--merge-install
--install-base /opt/AutowareAuto
--packages-skip $(cat external_deps.txt)
--return-code-on-test-failure
'
- 'colcon test-result --all |grep xml |cut -d":" -f1 |xargs .gitlab-ci/merge-test-results test-results.xml || true'
# Test package
- 'ros2 run autoware_auto_create_pkg main.py
--pkg-name my_cool_pkg
--destination /tmp/tmp_ws/src
--description "My cool package does cool stuff"
--maintainer "Jane Doe"
'
- cd /tmp/tmp_ws
- colcon build --packages-select my_cool_pkg
- colcon test --packages-select my_cool_pkg
- cd -
# prepare volume artifact
- mkdir /opt/AutowareAuto/src
- '(cd src && git archive --format=tar HEAD | (cd /opt/AutowareAuto/src && tar xf -))'
- cp -a LICENSE /opt/AutowareAuto
- chmod -R og-w /opt/AutowareAuto
- tar cfz opt.tar.gz /opt/AutowareAuto
after_script:
- colcon test-result --verbose
artifacts:
name: "$CI_JOB_NAME"
paths:
- log
- opt.tar.gz
reports:
junit: test-results.xml
.volume_base:
variables:
DOCKER_DRIVER: overlay2
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
ROS_DISTRO: foxy
UBUNTU_DISTRO: focal
stage: deploy
image: docker
services:
- docker:dind
script:
- 'echo -e "*\n!opt.tar.gz" > .dockerignore'
- |
cat >Dockerfile <<EOF
FROM alpine
ADD opt.tar.gz /
VOLUME /opt/AutowareAuto
CMD ["/bin/sh", "-c", "trap 'exit 147' TERM; tail -f /dev/null & wait ${!}"]
EOF
- 'docker build
--build-arg ROS_DISTRO=${ROS_DISTRO}
--build-arg CODENAME=${UBUNTU_DISTRO}
--label ade_image_commit_sha="$CI_COMMIT_SHA"
--label ade_image_commit_tag="$CI_COMMIT_TAG"
-t image .
'
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag image $CI_REGISTRY_IMAGE/$ARCH/binary-$ROS_DISTRO:commit-$CI_COMMIT_SHA
- docker tag image $CI_REGISTRY_IMAGE/$ARCH/binary-$ROS_DISTRO:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY_IMAGE/$ARCH/binary-$ROS_DISTRO:commit-$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE/$ARCH/binary-$ROS_DISTRO:$CI_COMMIT_REF_NAME
after_script:
- docker container prune -f
- docker image prune -a -f
.arm64:
variables:
ARCH: arm64
tags:
- arm64
only:
- branches@autowarefoundation/autoware.auto/AutowareAuto
- tags@autowarefoundation/autoware.auto/AutowareAuto
gen_ros_deps_foxy:
image: ros:foxy
extends: .gen_deps_base
ade_amd64_foxy:
variables:
ARCH: amd64
extends: .ade_base
ade_arm64_foxy:
extends:
- .arm64
- .ade_base
build_amd64_foxy:
variables:
ARCH: amd64
tags:
- shared
extends: .build_base
needs:
- job: ade_amd64_foxy
build_arm64_foxy:
extends:
- .arm64
- .build_base
needs:
- job: ade_arm64_foxy
test_amd64_foxy:
variables:
ARCH: amd64
tags:
- shared
extends: .test_base
needs:
- build_amd64_foxy
test_arm64_foxy:
extends:
- .arm64
- .test_base
needs:
- build_arm64_foxy
coverage:
stage: test
image: $CI_REGISTRY_IMAGE/amd64/ade-foxy:commit-$CI_COMMIT_SHA
tags:
- shared
script:
- 'apt-get update && apt-get -y --no-install-recommends install
clang-tidy
git
git-lfs
'
- 'git lfs install'
- 'git lfs pull --include="*" --exclude=""'
- 'vcs import < autoware.auto.$ROS_DISTRO.repos'
- './tools/coverage/coverage.sh -u'
after_script:
- colcon test-result --verbose
artifacts:
name: "$CI_JOB_NAME"
paths:
- coverage
- log
coverage: /\s*lines.*:\s(\d+\.\d+\%\s\(\d+\sof\s\d+.*\))/
needs:
- ade_amd64_foxy
docs:
stage: build
image: $CI_REGISTRY_IMAGE/amd64/ade-foxy:commit-$CI_COMMIT_SHA
script:
- docs/.doxygen/build.py
artifacts:
name: "$CI_JOB_NAME"
paths:
- docs/_build/html
needs:
- ade_amd64_foxy
pages:
stage: deploy
image: alpine
script:
- mv docs/_build/html public
- mv coverage public
artifacts:
name: "$CI_JOB_NAME"
paths:
- public
only:
- master
needs:
- coverage
- docs
volume_amd64_foxy:
variables:
ARCH: amd64
extends: .volume_base
needs:
- test_amd64_foxy
volume_arm64_foxy:
extends:
- .arm64
- .volume_base
needs:
- test_arm64_foxy
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。