diff --git a/.gitlab-industrial-ci-kinetic-no-rosinstall.yml b/.gitlab-industrial-ci-kinetic-no-rosinstall.yml index f543aca9b79a522fb76d9e94331c96fd953db9ac..0ba4ce79e456ef20540a8e52b63ffd72ca1594c3 100644 --- a/.gitlab-industrial-ci-kinetic-no-rosinstall.yml +++ b/.gitlab-industrial-ci-kinetic-no-rosinstall.yml @@ -15,7 +15,7 @@ stages: before_script: - apk add --update bash coreutils tar wget python -industrial_ci_kinetic: +.industrial_ci_kinetic: stage: build before_script: - apk add --update bash coreutils tar @@ -30,6 +30,27 @@ industrial_ci_kinetic: CATKIN_CONFIG: '--cmake-args -DCMAKE_CXX_FLAGS=-Wno-ignored-attributes -Wno-int-in-bool-context --' when: always +industrial_ci_kinetic: + extends: .industrial_ci_kinetic + except: + - tags + +industrial_ci_kinetic_deploy: + extends: .industrial_ci_kinetic + variables: + AFTER_SCRIPT: "wget -q -O - https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/scripts/pre-deploy-cleanup.bash | bash" + DOCKER_COMMIT: industrial_ci_image + script: + - .ci_config/gitlab.sh + - cd $(mktemp -d) + - wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/deploy/Dockerfile + - wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/deploy/ros_entrypoint.bash + - chmod a+x ros_entrypoint.bash + - docker build -t ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME} . + - docker push ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME} + only: + - tags + ########################################################## ## Simple check for basic Python syntax errors; this is much less thorough than ## other options like pylint, but much faster and less strict diff --git a/.gitlab-industrial-ci-kinetic-with-rosinstall.yml b/.gitlab-industrial-ci-kinetic-with-rosinstall.yml index ef287329cf73362d71c51df25f00bf35cb44420a..07c725c862583991756eb2ddcb31f71a39c8e2f9 100644 --- a/.gitlab-industrial-ci-kinetic-with-rosinstall.yml +++ b/.gitlab-industrial-ci-kinetic-with-rosinstall.yml @@ -15,7 +15,7 @@ stages: before_script: - apk add --update bash coreutils tar wget python -industrial_ci_kinetic: +.industrial_ci_kinetic: stage: build before_script: - apk add --update bash coreutils tar @@ -32,6 +32,27 @@ industrial_ci_kinetic: CATKIN_CONFIG: '--cmake-args -DCMAKE_CXX_FLAGS=-Wno-ignored-attributes -Wno-int-in-bool-context --' when: always +industrial_ci_kinetic: + extends: .industrial_ci_kinetic + except: + - tags + +industrial_ci_kinetic_deploy: + extends: .industrial_ci_kinetic + variables: + AFTER_SCRIPT: "wget -q -O - https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/scripts/pre-deploy-cleanup.bash | bash" + DOCKER_COMMIT: industrial_ci_image + script: + - .ci_config/gitlab.sh + - cd $(mktemp -d) + - wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/deploy/Dockerfile + - wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/deploy-image-build/deploy/ros_entrypoint.bash + - chmod a+x ros_entrypoint.bash + - docker build -t ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME} . + - docker push ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME} + only: + - tags + ########################################################## ## Simple check for basic Python syntax errors; this is much less thorough than ## other options like pylint, but much faster and less strict diff --git a/deploy/Dockerfile b/deploy/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8fdec02a867742b41b1e6a5f55869effde241786 --- /dev/null +++ b/deploy/Dockerfile @@ -0,0 +1,8 @@ +FROM industrial_ci_image + +RUN rm -rf /root/ici /root/src + +COPY ./ros_entrypoint.bash / + +ENTRYPOINT ["/ros_entrypoint.bash"] +CMD ["bash"] diff --git a/deploy/ros_entrypoint.bash b/deploy/ros_entrypoint.bash new file mode 100755 index 0000000000000000000000000000000000000000..01fe41cd7ccee5b782acc9bbc7b1a508f1e00221 --- /dev/null +++ b/deploy/ros_entrypoint.bash @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +# setup application environment +source "/root/catkin_ws/install/setup.bash" +exec "$@" diff --git a/scripts/pre-deploy-cleanup.bash b/scripts/pre-deploy-cleanup.bash new file mode 100644 index 0000000000000000000000000000000000000000..ad2000c5b73984031c87c33f9a6701a73876d6b8 --- /dev/null +++ b/scripts/pre-deploy-cleanup.bash @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +rm -rf /root/catkin_ws/build /root/catkin_ws/devel /root/catkin_ws/logs /root/catkin_ws/src + +# Unset env vars?