Skip to content
Snippets Groups Projects
Commit 80380e90 authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[CICD] First commit for Edgehog project integration test

* Insert Edgehog Docker image instead of that from container registry
* Perform only manifest integration
parent 9b8cf51c
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ variables: ...@@ -28,7 +28,7 @@ variables:
tags: tags:
- infrastructure - infrastructure
timeout: 10m timeout: 10m
image: "${CI_IMAGE_PYTHON}" image: secodocker/edgehog-builder:latest #"${CI_IMAGE_PYTHON}"
needs: [] needs: []
variables: variables:
# Include git submodules # Include git submodules
......
...@@ -37,7 +37,7 @@ workflow: ...@@ -37,7 +37,7 @@ workflow:
# the project in the seco-ne namespace (customer sending # the project in the seco-ne namespace (customer sending
# change to us). Here the the IDs used below differ. # change to us). Here the the IDs used below differ.
# #
- if: $CI_PROJECT_ROOT_NAMESPACE == "seco-ne" - if: $CI_PROJECT_ROOT_NAMESPACE == "edgehog"
&& $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID && $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
...@@ -59,6 +59,10 @@ integrate: ...@@ -59,6 +59,10 @@ integrate:
cache: cache:
policy: push policy: push
script: script:
- echo "CI_PROJECT_DIR is defined as ${CI_PROJECT_DIR}"
- echo "CI_PROJECT_PATH is defined as ${CI_PROJECT_PATH}"
- echo "CI_SERVER_URL is defined as ${CI_SERVER_URL}"
- echo "CI_MERGE_REQUEST_IID is defined as ${CI_MERGE_REQUEST_IID}"
- cd ${CI_PROJECT_DIR} - cd ${CI_PROJECT_DIR}
- if [ -n "${CI_MERGE_REQUEST_IID}" ];then - if [ -n "${CI_MERGE_REQUEST_IID}" ];then
MERGE_REQUEST="${CI_MERGE_REQUEST_IID}"; MERGE_REQUEST="${CI_MERGE_REQUEST_IID}";
...@@ -79,93 +83,94 @@ integrate: ...@@ -79,93 +83,94 @@ integrate:
paths: paths:
- manifest_revision - manifest_revision
yamllint: # yamllint:
extends: .yamllint # extends: .yamllint
#
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
# Stage: merge # # Stage: merge
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
merge: # merge:
extends: .infrastructure # extends: .infrastructure
stage: merge # stage: merge
rules: # rules:
- if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT # - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT
script: # script:
- cd ${CI_PROJECT_DIR} # - cd ${CI_PROJECT_DIR}
- .gitlab-ci/scripts/merge_into_manifest.py # - .gitlab-ci/scripts/merge_into_manifest.py
--gitlab-url=${CI_SERVER_URL} # --gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN} # --token=${GITBOT_TOKEN}
--manifest-project=${MANIFEST_PROJECT} # --manifest-project=${MANIFEST_PROJECT}
--master-branch=${MASTER_BRANCH_MANIFEST} # --master-branch=${MASTER_BRANCH_MANIFEST}
--project=${CI_PROJECT_PATH} # --project=${CI_PROJECT_PATH}
--master-branch-project=${MASTER_BRANCH_PROJECT} # --master-branch-project=${MASTER_BRANCH_PROJECT}
--commit=${CI_COMMIT_SHA} # --commit=${CI_COMMIT_SHA}
--save-revision-to=manifest_revision # --save-revision-to=manifest_revision
--recipe-name=${BB_RECIPE_NAME} # --recipe-name=${BB_RECIPE_NAME}
artifacts: # artifacts:
paths: # paths:
- manifest_revision # - manifest_revision
#
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
# Stage: build # # Stage: build
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
build: # build:
stage: build # stage: build
rules: # rules:
# Do not run build if the "skip build" label is set on the merge request # # Do not run build if the "skip build" label is set on the merge request
- if: $CI_MERGE_REQUEST_LABELS =~ /skip build/ # - if: $CI_MERGE_REQUEST_LABELS =~ /skip build/
when: never # when: never
# execute this in MR only and not for integrate/gitlab-ci/ integrations # # execute this in MR only and not for integrate/gitlab-ci/ integrations
# branches. These are build after the integration has been done in all # # branches. These are build after the integration has been done in all
# projects # # projects
- if: $CI_MERGE_REQUEST_IID && $CI_COMMIT_REF_NAME !~ /^integrate\/gitlab-ci\/.*/ # - if: $CI_MERGE_REQUEST_IID && $CI_COMMIT_REF_NAME !~ /^integrate\/gitlab-ci\/.*/
trigger: # trigger:
project: !reference [variables, MANIFEST_PROJECT] # project: !reference [variables, MANIFEST_PROJECT]
branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}" # branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}"
strategy: depend # strategy: depend
#
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
# Stage: check # # Stage: check
# -------------------------------------------------------------------------------------- # # --------------------------------------------------------------------------------------
check: # check:
extends: .infrastructure # extends: .infrastructure
stage: check # stage: check
rules: # rules:
# Do not run check if the "skip build" label is set on the merge request # # Do not run check if the "skip build" label is set on the merge request
- if: $CI_MERGE_REQUEST_LABELS =~ /skip build/ # - if: $CI_MERGE_REQUEST_LABELS =~ /skip build/
when: never # when: never
# Do not integration pipeline for merge requests for integrate/gitlab-ci/ branches # # Do not integration pipeline for merge requests for integrate/gitlab-ci/ branches
# The integration is done from the pipeline in gitlab-ci already # # The integration is done from the pipeline in gitlab-ci already
- if: $CI_COMMIT_REF_NAME =~ /^integrate\/gitlab-ci\/.*/ # - if: $CI_COMMIT_REF_NAME =~ /^integrate\/gitlab-ci\/.*/
when: never # when: never
- if: $CI_MERGE_REQUEST_IID # - if: $CI_MERGE_REQUEST_IID
# Explicitly allow externally triggered pipelines in every case # # Explicitly allow externally triggered pipelines in every case
- if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" # - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api"
needs: ["integrate"] # needs: ["integrate"]
allow_failure: true # allow_failure: true
script: # script:
- cd ${CI_PROJECT_DIR} # - cd ${CI_PROJECT_DIR}
# When running in a trigger pipeline the CII_MERGE_REQUEST_IID is not set # # When running in a trigger pipeline the CII_MERGE_REQUEST_IID is not set
# but CI_OPEN_MERGE_REQUESTS. We use the first of this comma separated list # # but CI_OPEN_MERGE_REQUESTS. We use the first of this comma separated list
# in this case # # in this case
- if [ -n "${CI_MERGE_REQUEST_IID}" ];then # - if [ -n "${CI_MERGE_REQUEST_IID}" ];then
MERGE_REQUEST="${CI_MERGE_REQUEST_IID}"; # MERGE_REQUEST="${CI_MERGE_REQUEST_IID}";
else # else
MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}"; # MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}";
fi # fi
# The 'parent_merge_request' is passed from the trigger # # The 'parent_merge_request' is passed from the trigger
# in case this check job is part of a gitlab-ci integration # # in case this check job is part of a gitlab-ci integration
# pipeline. It is only used to display the correct MR to run again # # pipeline. It is only used to display the correct MR to run again
# in a failed check # # in a failed check
- if [ -n "${parent_merge_request}" ];then # - if [ -n "${parent_merge_request}" ];then
PARENT_MR="--parent-merge-request=${parent_merge_request}"; # PARENT_MR="--parent-merge-request=${parent_merge_request}";
fi # fi
- .gitlab-ci/scripts/check_if_integration_branch_is_up_to_date.py # - .gitlab-ci/scripts/check_if_integration_branch_is_up_to_date.py
--gitlab-url=${CI_SERVER_URL} # --gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN} # --token=${GITBOT_TOKEN}
--manifest-project=${MANIFEST_PROJECT} # --manifest-project=${MANIFEST_PROJECT}
--integration-base=${MASTER_BRANCH_MANIFEST} # --integration-base=${MASTER_BRANCH_MANIFEST}
--project=${CI_PROJECT_PATH} # --project=${CI_PROJECT_PATH}
--merge-request=${MERGE_REQUEST} # --merge-request=${MERGE_REQUEST}
--verbose # --verbose
${PARENT_MR} # ${PARENT_MR}
#
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment