Skip to content

Commit

Permalink
Revert "Removed Gitlab CI (#61)"
Browse files Browse the repository at this point in the history
This reverts commit d699f2a.
  • Loading branch information
esteve committed Oct 11, 2019
1 parent 3b6e7ec commit b0207b5
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .gitlab-ci.yml
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

0 comments on commit b0207b5

Please sign in to comment.