Skip to content
Snippets Groups Projects

Resolve "Improve CI template organization"

Merged Iñigo Moreno i Caireta requested to merge 35-improve-ci-template-organization into master
1 unresolved thread
Compare and Show latest version
5 files
+ 168
199
Compare changes
  • Side-by-side
  • Inline
Files
5
image: tecnalia-docker-dev.artifact.tecnalia.com/docker:git
include : 'https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/-/raw/35-improve-ci-template-organization/.gitlab-industrial-ci-no-rosinstall.yml'
variables:
TMPDIR: /builds/${CI_PROJECT_NAMESPACE}
GIT_LFS_SKIP_SMUDGE: 1 # Avoid fetching the files from LFS when doing git fetch
DEFAULT_DISTRO: "kinetic"
services:
- name: tecnalia-docker-dev.artifact.tecnalia.com/docker:dind
alias: docker
stages:
- build
workflow:
rules:
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/
variables:
DEFAULT_DISTRO: "kinetic"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^melodic-.*/
variables:
DEFAULT_DISTRO: "melodic"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^noetic-.*/
variables:
DEFAULT_DISTRO: "noetic"
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/
variables:
DEFAULT_DISTRO: "kinetic"
DEPLOY: "true"
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^melodic-.*/
variables:
DEFAULT_DISTRO: "melodic"
DEPLOY: "true"
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^noetic-.*/
variables:
DEFAULT_DISTRO: "noetic"
DEPLOY: "true"
- if: $CI_COMMIT_TAG
variables:
DEPLOY: "true"
- if: $CI_COMMIT_BRANCH
before_script:
- apk add --update bash coreutils tar wget
- docker login tecnalia-docker-dev.artifact.tecnalia.com -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
.industrial_ci:
stage: build
before_script:
- apk add --update bash coreutils tar
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config
- docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
- docker login tecnalia-docker-dev.artifact.tecnalia.com -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
script: .ci_config/gitlab.sh
variables:
ADDITIONAL_DEBS: curl
PARALLEL_BUILDS: 2 # keep this for now, since there seems to be memory limit issues in the ci VM
AFTER_SETUP_TARGET_WORKSPACE: rosenv && bash <(curl -Ls https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/scripts/ci_run_entry_points.sh) $$current_ws
CMAKE_ARGS: -DCMAKE_CXX_FLAGS=-Wno-ignored-attributes -Wno-int-in-bool-context
tags:
- docker
industrial_ci_kinetic:
extends: .industrial_ci
variables:
ROS_DISTRO: kinetic
DOCKER_IMAGE: "${ARTIFACT_DOCKER_URL}/flexbotics-base-devel:${ROS_DISTRO}"
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "kinetic"
- if: $BUILD_KINETIC
industrial_ci_melodic:
extends: .industrial_ci
variables:
ROS_DISTRO: melodic
DOCKER_IMAGE: "${ARTIFACT_DOCKER_URL}/flexbotics-base-devel:${ROS_DISTRO}"
rules:
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "melodic"
- if: $BUILD_MELODIC
industrial_ci_noetic:
extends: .industrial_ci
variables:
ROS_DISTRO: noetic
DOCKER_IMAGE: "${ARTIFACT_DOCKER_URL}/flexbotics-base-devel:${ROS_DISTRO}"
rules:
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "noetic"
- if: $BUILD_NOETIC
.industrial_ci_deploy:
extends: .industrial_ci
variables:
AFTER_SCRIPT: "wget -q -O - https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/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/-/archive/master/gitlab_templates-master.zip
- unzip gitlab_templates-master.zip && cd gitlab_templates-master/deploy
- cd base
- 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}
- cd ..
- cd dev
- docker build --build-arg APPLICATION_IMAGE=${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME} -t ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME}-dev .
- docker push ${ARTIFACT_DOCKER_URL}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME}-dev
- cd ..
rules:
- if: $DEPLOY
industrial_kinetic_deploy:
extends:
- industrial_ci_kinetic
- .industrial_ci_deploy
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "kinetic"
- if: $DEPLOY && $BUILD_KINETIC
industrial_melodic_deploy:
extends:
- industrial_ci_melodic
- .industrial_ci_deploy
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "melodic"
- if: $DEPLOY && $BUILD_MELODIC
industrial_noetic_deploy:
extends:
- industrial_ci_noetic
- .industrial_ci_deploy
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "noetic"
- if: $DEPLOY && $BUILD_NOETIC
include : 'https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/-/raw/35-improve-ci-template-organization/gitlab-ci/post-check.yml'
\ No newline at end of file
- DEFAULT_DISTRO: kinetic
\ No newline at end of file
Loading