forked from ika-rwth-aachen/etsi_its_messages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.codegen.yml
196 lines (183 loc) · 7.45 KB
/
.gitlab-ci.codegen.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
default:
tags: [privileged, amd64]
image: docker:24.0.7-git
services: [docker:24.0.7-dind]
before_script:
- apk update
- apk add bash python3
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- ./asn1/patches/patch.sh
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: /certs
GIT_SUBMODULE_STRATEGY: recursive
_ASN1C_CI_IMAGE: ${CI_REGISTRY_IMAGE}/asn1c:${CI_COMMIT_REF_SLUG}_ci
_ASN1C_IMAGE_LATEST: ${CI_REGISTRY_IMAGE}/asn1c:latest
_RGEN_CI_IMAGE: ${CI_REGISTRY_IMAGE}/rgen:${CI_COMMIT_REF_SLUG}_ci
_RGEN_IMAGE_LATEST: ${CI_REGISTRY_IMAGE}/rgen:latest
stages:
- Build Docker Images
- asn1c
- ROS Messages
- Conversion Headers
asn1c-docker:
stage: Build Docker Images
before_script:
- cd utils/codegen/docker
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build -t ${_ASN1C_CI_IMAGE} -f asn1c.Dockerfile .
- docker push ${_ASN1C_CI_IMAGE}
- |-
if [[ "${CI_COMMIT_REF_SLUG}" == "${CI_DEFAULT_BRANCH}" ]]; then
docker tag ${_ASN1C_CI_IMAGE} ${_ASN1C_IMAGE_LATEST}
docker push ${_ASN1C_IMAGE_LATEST}
fi
rgen-docker:
stage: Build Docker Images
before_script:
- cd utils/codegen/codegen-rust/docker
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build -t ${_RGEN_CI_IMAGE} -f rgen.Dockerfile ..
- docker push ${_RGEN_CI_IMAGE}
- |-
if [[ "${CI_COMMIT_REF_SLUG}" == "${CI_DEFAULT_BRANCH}" ]]; then
docker tag ${_RGEN_CI_IMAGE} ${_RGEN_IMAGE_LATEST}
docker push ${_RGEN_IMAGE_LATEST}
fi
etsi_its_cam_coding:
stage: asn1c
needs: ["asn1c-docker"]
script:
- >
./utils/codegen/asn1ToC.py
asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn
asn1/raw/cam_en302637_2/cdd/ITS-Container.asn
-t cam
-o etsi_its_coding/etsi_its_cam_coding
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_ASN1C_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_denm_coding:
stage: asn1c
needs: ["asn1c-docker"]
script:
- >
./utils/codegen/asn1ToC.py
asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn
asn1/raw/denm_en302637_3/cdd/ITS-Container.asn
-t denm
-o etsi_its_coding/etsi_its_denm_coding
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_ASN1C_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_cpm_ts_coding:
stage: asn1c
needs: ["asn1c-docker"]
script:
- >
./utils/codegen/asn1ToC.py
asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn
asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn
asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn
-t cpm_ts
-o etsi_its_coding/etsi_its_cpm_ts_coding
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_ASN1C_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_cam_msgs:
stage: ROS Messages
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToRosMsg.py
asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn
asn1/raw/cam_en302637_2/cdd/ITS-Container.asn
-o etsi_its_msgs/etsi_its_cam_msgs/msg
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_denm_msgs:
stage: ROS Messages
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToRosMsg.py
asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn
asn1/raw/denm_en302637_3/cdd/ITS-Container.asn
-o etsi_its_msgs/etsi_its_denm_msgs/msg
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_cpm_ts_msgs:
stage: ROS Messages
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToRosMsg.py
asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn
asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn
asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn
-o etsi_its_msgs/etsi_its_cpm_ts_msgs/msg
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_cam_conversion:
stage: Conversion Headers
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToConversionHeader.py
asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn
asn1/raw/cam_en302637_2/cdd/ITS-Container.asn
-t cam
-o etsi_its_conversion/etsi_its_cam_conversion/include/etsi_its_cam_conversion
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_denm_conversion:
stage: Conversion Headers
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToConversionHeader.py
asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn
asn1/raw/denm_en302637_3/cdd/ITS-Container.asn
-t denm
-o etsi_its_conversion/etsi_its_denm_conversion/include/etsi_its_denm_conversion
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi
etsi_its_cpm_ts_conversion:
stage: Conversion Headers
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToConversionHeader.py
asn1/raw/cpm_ts103324/asn/CPM-PDU-Descriptions.asn
asn1/raw/cpm_ts103324/asn/CPM-OriginatingStationContainers.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceivedObjectContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-PerceptionRegionContainer.asn
asn1/raw/cpm_ts103324/asn/CPM-SensorInformationContainer.asn
asn1/patched/cpm_ts103324/asn/cdd/ETSI-ITS-CDD.asn
-t cpm_ts
-o etsi_its_conversion/etsi_its_cpm_ts_conversion/include/etsi_its_cpm_ts_conversion
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi