Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Azure Pipelines with Gitlab CI #96

Merged
merged 16 commits into from
Oct 18, 2019
115 changes: 115 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
stages:
- build
- test
- deploy

build_cross_image:
stage: build
image: docker
services:
- docker:dind
script:
- '
apt-get update && apt-get install -y
qemu-user-static
'
- docker build --build-arg PERFORMANCE_TEST_DOCKER_ARCH=arm64v8 --build-arg PERFORMANCE_TEST_TARGET_ARCH=aarch64 -t performance_test_cross -f tools/Dockerimage.crossbuild .
- '
docker run -t -v `pwd`:`pwd` -w `pwd`
--rm performance_test_cross
sh -c "colcon build --merge-install --cmake-args -DCMAKE_TOOLCHAIN_FILE=`pwd`/tools/toolchain.cmake -DBUILD_TESTING=OFF"
'

build:
stage: build
image: osrf/ros:dashing-desktop
script:
- source /opt/ros/dashing/setup.bash
- apt-get update
- '
apt-get install -y
ros-dashing-osrf-testing-tools-cpp
default-jdk
maven
'
- pip3 install -U colcon-common-extensions pytest
- git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
- cd cyclonedds
- git checkout 4e805597631ed0dcbdc0eecfe9d532cb75180ae7 # Head as of 20190725
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=/opt/cyclonedds ../src
- cmake --build .
- sudo cmake --build . --target install
- find /opt/cyclonedds
- cd $CI_PROJECT_DIR
- mkdir -p /opt/performance_test
- '
colcon build
--install-base /opt/performance_test
--merge-install
--cmake-args
-DCMAKE_BUILD_TYPE=Release
-DPERFORMANCE_TEST_FORCE_CYCLONEDDS=BOOL:ON
--base-path performance_test
'
- cp LICENSE /opt/performance_test
- tar cfz opt.tar.gz /opt/performance_test
artifacts:
expire_in: 1 day
when: always
paths:
- log
- build
- opt.tar.gz


test:
stage: test
image: osrf/ros:dashing-desktop
dependencies:
- build
script:
- tar xf opt.tar.gz -C /
- '
colcon test
--install-base /opt/performance_test
--merge-install
--base-path performance_test
'
- 'colcon test-result --verbose'
artifacts:
expire_in: 1 day
when: always
paths:
- log

volume:
stage: deploy
image: docker
services:
- docker:dind
dependencies:
- build
before_script:
- ''
script:
- 'echo -e "*\n!opt.tar.gz" > .dockerignore'
- |
cat >Dockerfile <<EOF
FROM alpine
ADD opt.tar.gz /
VOLUME /opt/performance_test
CMD ["/bin/sh", "-c", "trap 'exit 147' TERM; tail -f /dev/null & wait ${!}"]
EOF
- '
docker build
--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:commit-$CI_COMMIT_SHA
- docker tag image $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE:commit-$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
69 changes: 0 additions & 69 deletions azure-pipelines.yml

This file was deleted.