-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhog-dynamic.yml
94 lines (87 loc) · 3.17 KB
/
hog-dynamic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2018-2025 The University of Birmingham
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
include:
- local: YAML/hog-common.yml
- local: YAML/hog-main.yml
.ci-rules: &ci-rules
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^test\/.*$/i'
when: never
- if: '$CI_COMMIT_MESSAGE =~ /DOXYGEN_ONLY/'
when: never
- if: '$CI_MERGE_REQUEST_TITLE =~ /^Draft:.*$/ && $CI_COMMIT_MESSAGE !~ /^RESOLVE_WIP:/'
when: never
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $HOG_DEVELOP_BRANCH && $HOG_DEVELOP_BRANCH != null'
when: on_success
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^(master|main|release).*$/ && $HOG_TARGET_BRANCH == null && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $HOG_DEVELOP_BRANCH'
when: on_success
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $HOG_TARGET_BRANCH && $HOG_TARGET_BRANCH != null && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $HOG_DEVELOP_BRANCH'
when: on_success
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $HOG_INTERMEDIATE_BRANCH && $INTERMEDIATE_BUILD == "1" && $HOG_INTERMEDIATE_BRANCH != null'
when: on_success
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $HOG_INTERMEDIATE_BRANCH && $CI_BUILD_STAGE == "collect" && $HOG_INTERMEDIATE_BRANCH != null'
when: on_success
.vars: &vars
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
# CI_DEBUG_TRACE: "true"
generate-config:
<<: *ci-rules
variables:
<<: *vars
stage: dynamic_generate
image: gitlab-registry.cern.ch/hog/hog-docker:master
script:
- if [[ ${HOG_CHECK_PROJVER} != 1 ]]; then
echo "Project version checker is disabled.";
tclsh ./Hog/Tcl/utils/generate_yaml.tcl -runall;
else
tclsh ./Hog/Tcl/utils/generate_yaml.tcl;
fi;
- echo "CREATE_JOB_ID=${CI_JOB_ID}" > .env
artifacts:
paths:
- generated-config.yml
- .env
interruptible: true
child-pipeline:
<<: *ci-rules
stage: dynamic_triggers
trigger:
include:
- artifact: generated-config.yml
job: generate-config
strategy: depend
collect_artifacts:
<<: *ci-rules
image: gitlab-registry.cern.ch/hog/hog-docker:master
stage: collect
script:
- if [ ! -f .env ]; then
echo "You must save a .env file as an upstream artifact containing the Child Pipeline Creator's Job ID as CREATE_JOB_ID";
exit 1;
else
source .env;
fi;
- glab auth login -t $HOG_PUSH_TOKEN -h $CI_SERVER_HOST
- tclsh Hog/Tcl/CI/download_child_artifacts.tcl $CI_PROJECT_ID $CI_COMMIT_SHA $CREATE_JOB_ID
- if [ $? -ne 0 ]; then
exit 1;
fi
coverage: '/Statements\s+:\s(\d+.?\d+)%/'
artifacts:
paths:
- bin/
expire_in: 30 days