-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit d699f2a.
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
stages: | ||
- build | ||
- test | ||
- deploy | ||
|
||
before_script: | ||
- source /opt/ros/crystal/setup.bash | ||
- apt-get update | ||
- ' | ||
apt-get install -y | ||
ros-crystal-osrf-testing-tools-cpp | ||
default-jre | ||
' | ||
- pip3 install -U colcon-common-extensions pytest | ||
|
||
build: | ||
stage: build | ||
image: osrf/ros:crystal-desktop | ||
script: | ||
- mkdir -p /opt/performance_test | ||
- ' | ||
colcon build | ||
--install-base /opt/performance_test | ||
--merge-install | ||
--cmake-args | ||
-DCMAKE_BUILD_TYPE=Release | ||
--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:crystal-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 |