-
Notifications
You must be signed in to change notification settings - Fork 30
/
.gitlab-ci.yml
152 lines (140 loc) · 4.78 KB
/
.gitlab-ci.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
include:
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/raw/master/ci-include/generic-ci.yml'
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/raw/master/ci-include/pipeline-jobs.yml'
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/raw/master/ci-include/pipeline-jobs-publish-to-repo.yml'
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/raw/master/ci-include/github-status-sync.yml'
variables:
UPSTREAM_PROJECT: indigo-dc/oidc-agent
STAGING_BRANCH_NAME: 'staging'
DOCKER_IMAGE_NAMESPACE: 'marcvs/build'
DOCKER_IMAGE_NAME: 'oidc-agent'
GIT_STRATEGY: clone
GIT_DEPTH: 0
# KI_OIDC_TRIGGER_TOKEN: glptt-c5d04fbd30ad088fcacdaadc90c974e18f35ecee
# TARGET_REPO: 'devel'
# The following varialbes can be overwritten only in specific targets
# See generic-ci.yml -> .repo-definition for the full list
# REPO_BASE => deprecated
# REPO_USER
# REPO_HOST
# PUBLISH_BUILD_RESULTS_REPO: 'devel'
# PUBLISH_TESTED_RESULTS_REPO: 'prerel'
# PUBLISH_MASTER_RESULTS_REPO: 'for-prod'
PREREL_BRANCH_NAME: 'prerel'
# PREREL_BRANCH_NAME: 'ci/move-buildfiles-out'
# See generic-ci.yml -> .build-definition for the full list
# DOCKER_IMAGE_VERSION
# DOCKER_IMAGE_VERSION_WINDOWS
# PREREL_BRANCH_NAME: 'feat/mytoken/server_profiles'
MTEAM_CI_EXTRA_REPOSITORY_STRING: 'deb https://repo.data.kit.edu/devel/${DISTRO}/${RELEASE} ./'
MTEAM_CI_EXTRA_REPOSITORY_KEY_URL: 'https://repo.data.kit.edu/devel/automatic-repo-data-kit-edu-key.gpg'
MTEAM_CI_EXTRA_REPOSITORY_URL_YUM: 'https://repo.data.kit.edu/devel/data-kit-edu-${DISTRO}${RELEASE}.repo'
MTEAM_CI_EXTRA_REPOSITORY_URL_ZYPPER: 'https://repo.data.kit.edu/devel/data-kit-edu-${DISTRO}${RELEASE}.repo'
MTEAM_CI_ADDITIONAL_PACKAGES_APT: 'mustache-spec libmustach-core-dev libclibs-list-dev'
MTEAM_CI_ADDITIONAL_PACKAGES_YUM: ''
MTEAM_CI_ADDITIONAL_PACKAGES_ZYPPER: ''
###### WINDOWS ######
build-windows-lib-64:
extends:
- .build-win-msys2-mingw64
- .on-push-and-master
variables:
DOCKER_IMAGE_VERSION_WINDOWS: 'latest'
artifacts:
paths:
- bin
- include
script:
- |
set -e
set -x
mkdir -p results/
make -j 1
make -j 1 install_includes INCLUDE_PATH=include
rm -rf bin
mkdir bin
cp lib/api/liboidc-agent* bin
dependencies:
- build-windows-64
build-windows-64:
extends:
- .build-win-msys2
- .on-push-and-master
variables:
DOCKER_IMAGE_VERSION_WINDOWS: 'latest'
artifacts:
paths:
- bin
- config
- VERSION
- logos/logo.ico
script:
- |
set -e
set -x
# Build
make -j 1 win
ls -la bin
trigger-ki-oidc-plugin:
stage: build
image: marcvs/build_oidc-agent_debian-trixie
needs:
- build-windows-64
- build-windows-lib-64
rules:
- if: $CI_PIPELINE_SOURCE != "push" && $CI_PIPELINE_SOURCE != "web"
when: never
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event"
variables:
TRIGGER_BRANCH: main
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
TRIGGER_BRANCH: main
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
variables:
TRIGGER_BRANCH: devel
script:
- !reference [.def-trigger-pipeline]
- |
trigger_pipeline --project-name m-team/oidc/ssh/ki-oidc-plugin\
--branch ${TRIGGER_BRANCH} \
--trigger-token ${TRIGGER_TOKEN_KI_OIDC_PLUGIN}
echo "KI_OIDC_PIPELINE_ID=${TRIGGERED_PIPELINE_ID}" >> ki-oidc-plugin.env
artifacts:
reports:
dotenv: ki-oidc-plugin.env
trigger-win-installer:
stage: build
image: marcvs/build_oidc-agent_debian-trixie
needs:
- build-windows-64
- trigger-ki-oidc-plugin
rules:
- if: $CI_PIPELINE_SOURCE != "push" && $CI_PIPELINE_SOURCE != "web"
when: never
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event"
variables:
TRIGGER_BRANCH: main
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
TRIGGER_BRANCH: main
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
variables:
TRIGGER_BRANCH: devel # TODO change back to devel if 5 is merged
script:
- !reference [.def-trigger-pipeline]
- !reference [.def-get-artifacts]
- |
echo "KI_OIDC_PIPELINE_ID: ${KI_OIDC_PIPELINE_ID}"
trigger_pipeline \
--project-name "m-team/oidc/oidc-agent-win-installer" \
--branch ${TRIGGER_BRANCH} \
--KI_OIDC_PIPELINE_ID ${KI_OIDC_PIPELINE_ID} \
--trigger-token ${TRIGGER_TOKEN_WIN_INSTALLER}
get_artifacts --upstream-project-name "m-team/oidc/oidc-agent-win-installer" \
--upstream-job-name "build-windows-64" \
--upstream-pipeline-id ${TRIGGERED_PIPELINE_ID}
artifacts:
paths:
- "results/*"