-
Notifications
You must be signed in to change notification settings - Fork 16
/
prepare-templates.js
72 lines (65 loc) · 2.87 KB
/
prepare-templates.js
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
/*********************************************************************
* Copyright (c) 2019-2021 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
'use strict'
const fs = require('fs-extra')
const path = require('path')
function prepareCheOperatorTemplates() {
const src = path.join(__dirname, 'node_modules', 'devspaces-operator', 'devspaces-operator', 'deploy', 'deployment', 'kubernetes', 'objects')
const templates = path.join(__dirname, 'templates', 'devspaces-operator', 'kubernetes')
fs.copySync(
path.join(src, '..', 'org_v2_checluster.yaml'),
path.join(templates, 'crds', 'org_checluster_cr.yaml'))
fs.copySync(
path.join(src, 'checlusters.org.eclipse.che.CustomResourceDefinition.yaml'),
path.join(templates, 'crds', 'org.eclipse.che_checlusters.yaml'))
fs.copySync(
path.join(src, 'che-operator.Deployment.yaml'),
path.join(templates, 'operator.yaml'))
fs.copySync(
path.join(src, 'che-operator.ServiceAccount.yaml'),
path.join(templates, 'service_account.yaml'))
fs.copySync(
path.join(src, 'che-operator.ClusterRoleBinding.yaml'),
path.join(templates, 'cluster_rolebinding.yaml'))
fs.copySync(
path.join(src, 'che-operator.ClusterRole.yaml'),
path.join(templates, 'cluster_role.yaml'))
fs.copySync(
path.join(src, 'che-operator.RoleBinding.yaml'),
path.join(templates, 'role_binding.yaml'))
fs.copySync(
path.join(src, 'che-operator.Role.yaml'),
path.join(templates, 'role.yaml'))
fs.copySync(
path.join(src, 'che-operator-service.Service.yaml'),
path.join(templates, 'webhook-service.yaml'))
fs.copySync(
path.join(src, 'che-operator-serving-cert.Certificate.yaml'),
path.join(templates, 'serving-cert.yaml'))
fs.copySync(
path.join(src, 'che-operator-selfsigned-issuer.Issuer.yaml'),
path.join(templates, 'selfsigned-issuer.yaml'))
fs.copySync(
path.join(src, 'org.eclipse.che.ValidatingWebhookConfiguration.yaml'),
path.join(templates, 'org.eclipse.che.ValidatingWebhookConfiguration.yaml'))
fs.copySync(
path.join(src, 'org.eclipse.che.MutatingWebhookConfiguration.yaml'),
path.join(templates, 'org.eclipse.che.MutatingWebhookConfiguration.yaml'))
}
function prepareDevWorkspaceOperatorTemplates() {
const src = path.join(__dirname, 'node_modules', 'devworkspace-operator', 'deploy', 'deployment', 'kubernetes')
const templates = path.join(__dirname, 'templates', 'devworkspace-operator', 'kubernetes')
fs.copySync(
path.join(src, 'combined.yaml'),
path.join(templates, 'combined.yaml'))
}
fs.removeSync(path.join(__dirname, 'templates'))
prepareCheOperatorTemplates()
prepareDevWorkspaceOperatorTemplates()