Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • miguel.prada/gitlab_templates
  • tecnalia_robotics-public/gitlab_templates
2 results
Show changes
Commits on Source (119)
Showing
with 162 additions and 101 deletions
shellcheck:
image: tecnalia-docker-dev.artifact.tecnalia.com/koalaman/shellcheck-alpine
script: shellcheck deploy/base/ros_entrypoint.bash scripts/*sh
image: tecnalia-docker-dev.artifact.tecnalia.dev/koalaman/shellcheck-alpine
script: shellcheck scripts/*sh
tags:
- docker
# The ignored rules in hadolint checks are
# DL3006 Always tag the version of an image explicitly
# One of the Dockerfiles uses a temporary image which isn't important to tag
# and the other uses a tagged image through an ARG, which apparently is not
# properly recognized.
# DL3008 Pin versions in apt-get install
# A bit overkill
dockerfiles:
image: tecnalia-docker-dev.artifact.tecnalia.com/hadolint/hadolint:latest-debian
script:
- RET=0
- hadolint --ignore DL3006 --ignore DL3008 deploy/base/Dockerfile || RET=1
- hadolint --ignore DL3006 --ignore DL3008 deploy/dev/Dockerfile || RET=1
- exit $RET
tags:
- docker
yamllint:
image: tecnalia-docker-dev.artifact.tecnalia.com/sdesbure/yamllint
image: tecnalia-docker-dev.artifact.tecnalia.dev/sdesbure/yamllint
script: yamllint $(find . -name '*.yml' -o -name '*.yaml')
tags:
- docker
......@@ -36,3 +20,30 @@ deploy_devcontainer:
expire_in: 1 year
tags:
- docker
.simple_ros_test:
variables:
TEMPLATES_PIPELINE_REF: $CI_COMMIT_REF_NAME
trigger:
project: tecnalia_robotics/ci_test_repos/simple_ros_test
strategy: depend
simple_ros_melodic_test:
extends: .simple_ros_test
variables:
TEMPLATE_TO_USE: ci-templates/auto-rules/melodic-default.yml
simple_ros_noetic_test:
extends: .simple_ros_test
variables:
TEMPLATE_TO_USE: ci-templates/auto-rules/noetic-default.yml
simple_ros_core_with_noetic_test:
extends: .simple_ros_test
variables:
TEMPLATE_TO_USE: test/core_with_noetic.yml
simple_ros_auto_rules_melodic_noetic_test:
extends: .simple_ros_test
variables:
TEMPLATE_TO_USE: test/auto_rules_melodic_noetic.yml
include:
- project: tecnalia_robotics-public/gitlab_templates
file: ci-templates/auto-rules/kinetic-default.yml
\ No newline at end of file
file: ci-templates/auto-rules/kinetic-default.yml
include:
- project: tecnalia_robotics-public/gitlab_templates
file: ci-templates/auto-rules/with-rosinstall/kinetic-default.yml
\ No newline at end of file
file: ci-templates/auto-rules/with-rosinstall/kinetic-default.yml
......@@ -9,11 +9,3 @@ include::ci-templates/README.adoc[leveloffset=+1]
== Custom `rosdep` definitions
Custom `rosdep` definitions for the packages hosted in our internal debian repository are declared in link:rosdistro/rosdep_tecnalia.yaml[].
== Deployment image build resources
Resources required for building the deployment docker images are also hosted in this repository.
This basically boils down to:
- link:scripts/pre-deploy-cleanup.bash[] is run in the `.industrial_ci_deploy` template before commiting to an image
- link:deploy/Dockerfile[] is used to perform some additional cleanup and install link:deploy/ros_entrypoint.bash[] as entrypoint script on top of the `industrial_ci` image
......@@ -17,18 +17,20 @@ The Core pipeline, defined in link:ci-templates/core.yml[], has the following st
** If the package has `.rosinstall` dependencies, they can be installed using the variable `UPSTREAM_WORKSPACE`
** Uses `flexbotics-base-devel:${ROS_DISTRO}` as a starting image
** Runs link:scripts/ci_run_entry_points.sh[] in the `AFTER_SETUP_TARGET_WORKSPACE` stage, which in turn finds and runs every `ci_entry_script.bash` script found in the target repo.
* `.industrial_ci_deploy` template, which:
** Runs `industrial_ci` by extending `.industrial_ci`
** Runs some cleanup in the `industrial_ci` context (e.g. delete sources)
** Commits image used by `industrial_ci`
** Builds deployment image on top of it and push it to our registry
- Stage: `deploy`
* `.ddeploy` template (see https://git.code.tecnalia.dev/tecnalia_robotics/flexbotics/flexbotics_utils/ddeploy[the ddeploy repo]), which:
** Is run automatically for tags, but can also be run manually on normal commits
** Calls `ddeploy` to generate the docker image
** Renames the image created by ddeploy with different tags and pushes them to the registry.
*** Tag `${COMMIT_SHA}` (hash of commit)
*** Tag `${CI_COMMIT_REF_NAME}` (branch or tag name)
*** Tag `latest` only on the default branch
- Stage: `.post`
* Check `bash`/`sh` script syntax
* Check Markdown and AsciiDoc syntax
* Check files have no trailing whitespace and are `UTF-8` encoded
* Check that `C++` files follow this link:clang-format[]
It is important to note that both templates set the variable `GIT_LFS_SKIP_SMUDGE`, which means that when the repositories are cloned/fetched, the files hosted using Git LFS will not be downloaded. An example on how to explicitely fetch the files from LFS can be found in the https://git.code.tecnalia.com/tecnalia_robotics/common_config/blob/e93dbe6379d94e6a895a33c59bf17ccab26eacf9/.gitlab-ci.yml#L132[common_config repository].
== Manual Jobs
......@@ -52,3 +54,11 @@ The auto rules also allow for using variables to explicitely activate each job:
```yml
include::examples/build_vars.yml[]
```
If a `ddeploy.yaml` file exists, the auto-rules will add a job extending the `.ddeploy` template defined
== LFS
By default, lfs files are not downloaded. If you need to add LFS, include the link:ci-templates/lfs-pull.yml[] along with anything else:
```yml
include::examples/include_lfs.yml[]
```
\ No newline at end of file
include: ci-templates/auto-rules/no-default.yml
variables:
DEFAULT_DISTRO: humble
include: ci-templates/auto-rules/no-default.yml
variables:
DEFAULT_DISTRO: jazzy
include : ci-templates/auto-rules/no-default.yml
include: ci-templates/auto-rules/no-default.yml
variables:
DEFAULT_DISTRO: kinetic
\ No newline at end of file
DEFAULT_DISTRO: kinetic
include : ci-templates/auto-rules/no-default.yml
include: ci-templates/auto-rules/no-default.yml
variables:
DEFAULT_DISTRO: melodic
\ No newline at end of file
DEFAULT_DISTRO: melodic
include : ci-templates/core.yml
include: ci-templates/core.yml
workflow:
rules:
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/
- if: $CI_COMMIT_REF_NAME =~ /^kinetic-.*/
variables:
DEFAULT_DISTRO: "kinetic"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^melodic-.*/
- if: $CI_COMMIT_REF_NAME =~ /^melodic-.*/
variables:
DEFAULT_DISTRO: "melodic"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME =~ /^noetic-.*/
- if: $CI_COMMIT_REF_NAME =~ /^noetic-.*/
variables:
DEFAULT_DISTRO: "noetic"
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^kinetic-.*/
- if: $CI_COMMIT_REF_NAME =~ /^humble-.*/
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-.*/
DEFAULT_DISTRO: "humble"
- if: $CI_COMMIT_REF_NAME =~ /^jazzy-.*/
variables:
DEFAULT_DISTRO: "noetic"
DEPLOY: "true"
DEFAULT_DISTRO: "jazzy"
- if: $CI_COMMIT_TAG
variables:
DEPLOY: "true"
- if: $CI_COMMIT_BRANCH
industrial_ci_kinetic:
extends: .industrial_ci
variables:
ROS_DISTRO: kinetic
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "kinetic"
- if: $BUILD_KINETIC
......@@ -44,8 +33,6 @@ industrial_ci_melodic:
variables:
ROS_DISTRO: melodic
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "melodic"
- if: $BUILD_MELODIC
......@@ -54,33 +41,79 @@ industrial_ci_noetic:
variables:
ROS_DISTRO: noetic
rules:
- if: $DEPLOY
when: never
- if: $DEFAULT_DISTRO == "noetic"
- if: $BUILD_NOETIC
industrial_ci_humble:
extends: .industrial_ci
variables:
ROS_DISTRO: humble
rules:
- if: $DEFAULT_DISTRO == "humble"
- if: $BUILD_HUMBLE
industrial_ci_jazzy:
extends: .industrial_ci
variables:
ROS_DISTRO: jazzy
rules:
- if: $DEFAULT_DISTRO == "jazzy"
- if: $BUILD_JAZZY
industrial_kinetic_deploy:
extends:
- industrial_ci_kinetic
- .industrial_ci_deploy
.py3_rules:
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "kinetic"
- if: $DEPLOY && $BUILD_KINETIC
- if: $DEFAULT_DISTRO == "noetic"
when: always
- if: $BUILD_NOETIC
when: always
- if: $DEFAULT_DISTRO == "humble"
when: always
- if: $BUILD_HUMBLE
when: always
- if: $DEFAULT_DISTRO == "jazzy"
when: always
- if: $BUILD_JAZZY
when: always
py3-flake8:
extends:
- .py3_rules
- .py3-flake8
industrial_melodic_deploy:
py3-flake8_extended:
extends:
- industrial_ci_melodic
- .industrial_ci_deploy
- .py3_rules
- .py3-flake8_extended
py3-security:
extends:
- .py3_rules
- .py3-security
.py2_rules:
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "melodic"
- if: $DEPLOY && $BUILD_MELODIC
- if: $DEFAULT_DISTRO == "kinetic"
when: always
- if: $BUILD_KINETIC
when: always
- if: $DEFAULT_DISTRO == "melodic"
when: always
- if: $BUILD_MELODIC
when: always
industrial_noetic_deploy:
py2-flake8:
extends:
- industrial_ci_noetic
- .industrial_ci_deploy
- .py2_rules
- .py2-flake8
ddeploy:
extends: .ddeploy
rules:
- if: $DEPLOY && $DEFAULT_DISTRO == "noetic"
- if: $DEPLOY && $BUILD_NOETIC
- if: $CI_COMMIT_TAG
exists:
- ddeploy.yaml
when: always
- exists:
- ddeploy.yaml
when: manual
allow_failure: true
include : ci-templates/auto-rules/no-default.yml
include: ci-templates/auto-rules/no-default.yml
variables:
DEFAULT_DISTRO: noetic
\ No newline at end of file
DEFAULT_DISTRO: noetic
include: ci-templates/auto-rules/with-rosinstall/no-default.yml
variables:
DEFAULT_DISTRO: humble
include: ci-templates/auto-rules/with-rosinstall/no-default.yml
variables:
DEFAULT_DISTRO: jazzy
include : ci-templates/auto-rules/with-rosinstall/no-default.yml
include: ci-templates/auto-rules/with-rosinstall/no-default.yml
variables:
DEFAULT_DISTRO: kinetic
\ No newline at end of file
DEFAULT_DISTRO: kinetic
include : ci-templates/auto-rules/with-rosinstall/no-default.yml
include: ci-templates/auto-rules/with-rosinstall/no-default.yml
variables:
DEFAULT_DISTRO: melodic
\ No newline at end of file
DEFAULT_DISTRO: melodic
include : ci-templates/auto-rules/no-default.yml
include: ci-templates/auto-rules/no-default.yml
.industrial_ci:
variables:
UPSTREAM_WORKSPACE: .rosinstall
\ No newline at end of file
UPSTREAM_WORKSPACE: .rosinstall
include : ci-templates/auto-rules/with-rosinstall/no-default.yml
include: ci-templates/auto-rules/with-rosinstall/no-default.yml
variables:
DEFAULT_DISTRO: noetic
\ No newline at end of file
DEFAULT_DISTRO: noetic
image: tecnalia-docker-dev.artifact.tecnalia.com/docker:git
image: tecnalia-docker-dev.artifact.tecnalia.dev/docker:git
workflow:
......@@ -11,21 +10,16 @@ variables:
TMPDIR: /builds/${CI_PROJECT_NAMESPACE}
GIT_LFS_SKIP_SMUDGE: 1 # Avoid fetching the files from LFS when doing git fetch
services:
- name: tecnalia-docker-dev.artifact.tecnalia.com/docker:dind
alias: docker
stages:
- build
- deploy
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}
include :
include:
- ci-templates/syntax-check.yml
- ci-templates/python.yml
- ci-templates/industrial-ci-templates.yml
default:
tags:
- docker
\ No newline at end of file
- docker
include:
- project: tecnalia_robotics-public/gitlab_templates
file:
- ci-templates/auto-rules/kinetic-default.yml
- ci-templates/lfs-pull.yml
......@@ -3,7 +3,7 @@ include:
file: ci-templates/core.yml
industrial_ci_kinetic:
extends: .industrial-ci
extends: .industrial_ci
variables:
ROS_DISTRO: kinetic
UPSTREAM_WORKSPACE: .rosinstall
\ No newline at end of file
UPSTREAM_WORKSPACE: .rosinstall