-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopier.yml
156 lines (131 loc) · 5.11 KB
/
copier.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
_message_before_copy: |
This template will create a new repository which describes the Kubernetes configuration for IOC and service instances. Each repository represents a group of IOCs and services that are deployed to *the same cluster* and the *same namespace*. The grouping can be arbitrary, e.g. by beamline, location, technical area, maintainer etc.
# minimum version for new style of migrations
_min_copier_version: "9.3.0"
_migrations:
- version: 4.0.3b3
when: "{{ _stage == 'before' }}"
# introduce the symlinked folders to every IOC in the repo
command: |
echo "Migrating $(pwd) to Template v${VERSION_CURRENT}"
# move templates to avoid 'symlink over existing folder' copier bug
mv services/.ioc_template/templates .backup-templates
ls .backup-templates
# update all iocs (using chart ioc-instance) to use the shared boilerplate
for i in $(grep -l ioc-instance services/*/Chart.yaml); do
ioc=$(dirname $i)
rm -rf $ioc/templates
ln -srfn .helm-shared/templates $ioc/templates
ln -srfn .helm-shared/Chart.yaml $ioc/Chart.yaml
done
- version: 4.0.3b3
when: "{{ _stage == 'after' }}"
# restore templates file to the shared boilerplate folder
command: |
# copier honours deletion of templates folder above so we must restore it
rm -rf .helm-shared/templates
mv .backup-templates .helm-shared/templates
_subdirectory: "template"
_preserve_symlinks: true
ioc_group:
type: str
help: |
A name for this group of IOC and service instances.
At DLS this should be the short beamline name or the technical area
for accelerator repos.
placeholder: e.g. "i16", "b01-1", "p47" "vacuum"
validator: >-
{% if not (ioc_group | regex_search('^[a-zA-Z][a-zA-Z-0-9]+$')) %}
{{ioc_group}} must be alphanumeric plus hyphens and start with a letter.
{% endif %}
description:
type: str
help: A One line description of the module
default: >-
{{ ioc_group }} IOC Instances and Services
location:
type: str
help: |
Default location where these IOCs and services will run.
At DLS this should be beamline shortname or blank for the accelerator.
default: >-
{{ ioc_group }}
validator: >-
{% if not (ioc_group | regex_search('^[a-zA-Z][a-zA-Z-0-9]+$')) %}
{{ioc_group}} must be alphanumeric and start with a letter, it may contain hyphens
{% endif %}
cluster_name:
type: str
help: |
The Kubernetes cluster where the IOCs and services will run.
At DLS this should be "k8s-{beamline shortname}", "acastus" for the
accelerator or "pollux" for test beamlines.
placeholder: e.g. "k8s-i16", "k8s-b01-1", "pollux", "acastus"
validator: >-
{% if not (cluster_name | regex_search('^[a-z][a-z-0-9]+$')) %}
{{cluster_name}} must be lower case alphanumeric and start with a letter,
it may contain hyphens
{% endif %}
cluster_namespace:
type: str
help: |
Kubernetes namespace in which the IOCs and services will run.
At DLS this should be "{beamline shortname}-beamline" or "accelerator".
placeholder: e.g. "i16-beamline", "b01-1-beamline", "p47-beamline", "accelerator"
validator: >-
{% if not (cluster_namespace | regex_search('^[a-z][a-z-0-9]+$')) %}
{{cluster_namespace}} must be lower case alphanumeric and start with a letter,
it may contain hyphens
{% endif %}
cluster_type:
type: str
help: |
Apply cluster specific details.
To add to this list make a PR to services-template-helm.
choices:
Skip: ""
DLS Cluster: dls_cluster
default: dls_cluster
git_platform:
type: str
help: |
Git platform hosting this repository.
To add to this list make a PR to services-template-helm.
choices:
- github.com
- gitlab.diamond.ac.uk
github_org:
type: str
help: The GitHub organisation that will contain this repo.
placeholder: e.g. your own GitHub account or epics-containers
when: >-
{{ git_platform == 'github.com' }}
validator: >-
{% if not (github_org | regex_search('^[a-zA-Z][a-zA-Z-0-9]+$')) %}
{{github_org}} must be lower case AlphaNumeric and start with a letter,
it may contain hyphens
{% endif -%}
dls_technical_area:
type: str
help: The DLS gitlab subfolder for this repo.
when: >-
{{ git_platform == 'gitlab.diamond.ac.uk' }}
choices:
- beamline
- accelerator
repo_uri:
type: str
help: Remote URI of the services repository.
default: >-
{% if git_platform == 'gitlab.diamond.ac.uk' -%}
https://{{git_platform}}/controls/containers/{{dls_technical_area}}/{{ioc_group}}-services
{%- else -%}
https://{{git_platform}}/{{github_org}}/{{ioc_group}}-services
{%- endif %}
logging_url:
type: str
help: URL for centralized logging. Leave blank if not applicable.
choices:
Skip: ""
DLS GrayLog: https://graylog2.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*
default: https://graylog2.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*