forked from openshift/release
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
279 lines (214 loc) · 10.1 KB
/
Makefile
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
SHELL=/usr/bin/env bash -o errexit
.PHONY: help check check-core check-services dry-core core dry-services services all
CONTAINER_ENGINE ?= docker
help:
@echo "Run 'make all' to update configuration against the current KUBECONFIG"
all: core services
check: check-core check-services
@echo "Service config check: PASS"
check-core:
core-services/_hack/validate-core-services.sh core-services
@echo "Core service config check: PASS"
check-services:
core-services/_hack/validate-core-services.sh services
@echo "Service config check: PASS"
# applyconfig is https://github.com/openshift/ci-tools/tree/master/cmd/applyconfig
dry-core:
applyconfig --config-dir core-services
dry-services:
applyconfig --config-dir services
core:
applyconfig --config-dir core-services --confirm=true
services:
applyconfig --config-dir services --confirm=true
# these are useful for devs
update:
$(MAKE) jobs
$(MAKE) ci-operator-config
$(MAKE) prow-config
release-controllers:
./hack/generators/release-controllers/generate-release-controllers.py .
cp ./core-services/release-controller/rpms-ocp-*.yaml ./clusters/build-clusters/01_cluster/openshift/release-controller
.PHONY: release-controllers
jobs:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/ci-operator-prowgen:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR):/go/src/github.com/openshift/release:z" -e GOPATH=/go registry.svc.ci.openshift.org/ci/ci-operator-prowgen:latest --from-release-repo --to-release-repo
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/sanitize-prow-jobs:latest
$(CONTAINER_ENGINE) run --rm --ulimit nofile=16384:16384 -v "$(CURDIR)/ci-operator/jobs:/ci-operator/jobs:z" -v "$(CURDIR)/core-services/sanitize-prow-jobs:/core-services/sanitize-prow-jobs:z" registry.svc.ci.openshift.org/ci/sanitize-prow-jobs:latest --prow-jobs-dir /ci-operator/jobs --config-path /core-services/sanitize-prow-jobs/_config.yaml
ci-operator-config:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/determinize-ci-operator:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/ci-operator/config:/ci-operator/config:z" registry.svc.ci.openshift.org/ci/determinize-ci-operator:latest --config-dir /ci-operator/config --confirm
registry-metadata:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/generate-registry-metadata:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/ci-operator/step-registry:/ci-operator/step-registry:z" registry.svc.ci.openshift.org/ci/generate-registry-metadata:latest --registry /ci-operator/step-registry
prow-config:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/determinize-prow-config:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/core-services/prow/02_config:/config:z" registry.svc.ci.openshift.org/ci/determinize-prow-config:latest --prow-config-dir /config
branch-cut:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/config-brancher:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/ci-operator:/ci-operator:z" registry.svc.ci.openshift.org/ci/config-brancher:latest --config-dir /ci-operator/config --org=$(ORG) --repo=$(REPO) --current-release=4.3 --future-release=4.4 --bump-release=4.4 --confirm
$(MAKE) update
new-repo:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/repo-init:latest
$(CONTAINER_ENGINE) run --rm -it -v "$(CURDIR):/release:z" registry.svc.ci.openshift.org/ci/repo-init:latest --release-repo /release
$(MAKE) update
validate-step-registry:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/ci-operator-configresolver:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/core-services/prow/02_config:/prow:z" -v "$(CURDIR)/ci-operator/config:/config:z" -v "$(CURDIR)/ci-operator/step-registry:/step-registry:z" registry.svc.ci.openshift.org/ci/ci-operator-configresolver:latest --config /config --registry /step-registry --prow-config /prow/_config.yaml --validate-only
# LEGACY TARGETS
# You should not need to add new targets here.
export RELEASE_URL=https://github.com/openshift/release.git
export RELEASE_REF=master
export SKIP_PERMISSIONS_JOB=0
apply:
oc apply -f $(WHAT)
.PHONY: apply
applyTemplate:
oc process -f $(WHAT) | oc apply -f -
.PHONY: applyTemplate
postsubmit-update: origin-release cincinnati prow-release-controller-definitions
.PHONY: postsubmit-update
all: roles prow projects
.PHONY: all
roles: cluster-operator-roles
.PHONY: roles
prow: prow-ci-ns prow-ci-stg-ns
.PHONY: prow
prow-ci-ns: ci-ns prow-jobs
.PHONY: prow-ci-ns
prow-ci-stg-ns: ci-stg-ns
$(MAKE) apply WHAT=cluster/ci/config/prow/openshift/ci-operator/stage.yaml
.PHONY: prow-ci-stg-ns
ci-ns:
oc project ci
.PHONY: ci-ns
ci-stg-ns:
oc project ci-stg
.PHONY: ci-stg-ns
openshift-ns:
oc project openshift
.PHONY: openshift-ns
prow-jobs: prow-artifacts
$(MAKE) apply WHAT=projects/prometheus/test/build.yaml
$(MAKE) apply WHAT=ci-operator/templates/os.yaml
.PHONY: prow-jobs
prow-artifacts:
oc create ns ci-pr-images -o yaml --dry-run | oc apply -f -
oc policy add-role-to-group system:image-puller system:unauthenticated -n ci-pr-images
oc policy add-role-to-group system:image-puller system:authenticated -n ci-pr-images
oc tag --source=docker centos:7 openshift/centos:7 --scheduled
oc create ns ci-rpms -o yaml --dry-run | oc apply -f -
oc apply -f ci-operator/infra/openshift/origin/
.PHONY: prow-artifacts
prow-release-controller-definitions:
hack/annotate.sh
.PHONY: prow-release-controller-definitions
prow-release-controller-deploy:
$(MAKE) apply WHAT=core-services/release-controller/
.PHONY: prow-release-controller-deploy
prow-release-controller: prow-release-controller-definitions prow-release-controller-deploy
.PHONY: prow-release-controller
projects: ci-ns origin-stable origin-release publishing-bot content-mirror azure metering coreos
.PHONY: projects
content-mirror:
$(MAKE) apply WHAT=projects/content-mirror/pipeline.yaml
.PHONY: content-mirror
node-problem-detector:
$(MAKE) apply WHAT=projects/kubernetes/node-problem-detector.yaml
.PHONY: node-problem-detector
kube-state-metrics:
$(MAKE) apply WHAT=projects/kube-state-metrics/pipeline.yaml
.PHONY: kube-state-metrics
oauth-proxy:
$(MAKE) apply WHAT=projects/oauth-proxy/pipeline.yaml
.PHONY: oauth-proxy
publishing-bot:
$(MAKE) apply WHAT=projects/publishing-bot/storage-class.yaml
.PHONY: publishing-bot
origin-stable:
$(MAKE) apply WHAT=projects/origin-stable/release.yaml
$(MAKE) apply WHAT=projects/origin-stable/stable-3.9.yaml
$(MAKE) apply WHAT=projects/origin-stable/stable-3.10.yaml
.PHONY: origin-stable
origin-release:
$(MAKE) applyTemplate WHAT=projects/origin-release/pipeline.yaml
oc tag docker.io/centos/ruby-25-centos7:latest --scheduled openshift/release:ruby-25
.PHONY: origin-release
prometheus: node-exporter alert-buffer
$(MAKE) apply WHAT=projects/prometheus/prometheus.yaml
.PHONY: prometheus
node-exporter:
$(MAKE) apply WHAT=projects/prometheus/node_exporter.yaml
.PHONY: node-exporter
service-idler:
$(MAKE) apply WHAT=projects/service-idler/pipeline.yaml
.PHONY: service-idler
alert-buffer:
$(MAKE) apply WHAT=projects/prometheus/alert-buffer.yaml
.PHONY: alert-buffer
cluster-operator-roles:
oc create ns openshift-cluster-operator --dry-run -o yaml | oc apply -f -
$(MAKE) apply WHAT=projects/cluster-operator/cluster-operator-team-roles.yaml
$(MAKE) applyTemplate WHAT=projects/cluster-operator/cluster-operator-roles-template.yaml
.PHONY: cluster-operator-roles
azure:
# set up azure namespace and policies
$(MAKE) apply WHAT=projects/azure/cluster-wide.yaml
$(MAKE) apply WHAT=projects/azure/rbac.yaml
# the rest of the config
$(MAKE) apply WHAT=projects/azure/azure-purge/
$(MAKE) apply WHAT=projects/azure/base-images/
$(MAKE) apply WHAT=projects/azure/image-mirror/
$(MAKE) apply WHAT=projects/azure/secret-refresh/
.PHONY: azure
azure-secrets:
oc create secret generic cluster-secrets-azure \
--from-file=cluster/test-deploy/azure/secret \
--from-file=cluster/test-deploy/azure/ssh-privatekey \
--from-file=cluster/test-deploy/azure/certs.yaml \
--from-file=cluster/test-deploy/azure/.dockerconfigjson \
--from-file=cluster/test-deploy/azure/system-docker-config.json \
--from-file=cluster/test-deploy/azure/logging-int.cert \
--from-file=cluster/test-deploy/azure/logging-int.key \
--from-file=cluster/test-deploy/azure/metrics-int.cert \
--from-file=cluster/test-deploy/azure/metrics-int.key \
-o yaml --dry-run | oc apply -n azure -f -
oc create secret generic cluster-secrets-azure-env --from-literal=azure_client_id=${AZURE_ROOT_CLIENT_ID} --from-literal=azure_client_secret=${AZURE_ROOT_CLIENT_SECRET} --from-literal=azure_tenant_id=${AZURE_ROOT_TENANT_ID} --from-literal=azure_subscription_id=${AZURE_ROOT_SUBSCRIPTION_ID} -o yaml --dry-run | oc apply -n azure-private -f -
.PHONY: azure-secrets
metering:
$(MAKE) -C projects/metering
.PHONY: metering
coreos:
$(MAKE) apply WHAT=projects/coreos/coreos.yaml
.PHONY: coreos
cincinnati:
$(MAKE) apply WHAT=projects/cincinnati/cincinnati.yaml
.PHONY: cincinnati
bump-pr:
$(MAKE) job JOB=periodic-prow-image-autobump
.PHONY: bump-pr
job:
hack/job.sh "$(JOB)"
.PHONY: job
kerberos_id ?= dptp
dry_run ?= true
force ?= false
bw_password_path ?= /tmp/bw_password
kubeconfig_path ?= $(HOME)/.kube/config
# these are useful for dptp-team
# echo -n "bw_password" > /tmp/bw_password
# make kerberos_id=<your_kerberos_id> cluster=app.ci ci-secret-bootstrap
ci-secret-bootstrap:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/ci-secret-bootstrap:latest
$(CONTAINER_ENGINE) run --rm -v "$(CURDIR)/core-services/ci-secret-bootstrap/_config.yaml:/_config.yaml:z" \
-v "$(kubeconfig_path):/_kubeconfig:z" \
-v "$(bw_password_path):/_bw_password:z" \
registry.svc.ci.openshift.org/ci/ci-secret-bootstrap:latest \
--bw-password-path=/_bw_password --bw-user $(kerberos_id)@redhat.com --config=/_config.yaml --kubeconfig=/_kubeconfig --dry-run=$(dry_run) --force=$(force) --cluster=$(cluster) --as=system:admin
.PHONY: ci-secret-bootstrap
verify-app-ci:
true
mixins:
$(CONTAINER_ENGINE) pull registry.svc.ci.openshift.org/ci/dashboards-validation:latest
$(CONTAINER_ENGINE) run --user=$(UID) --rm -v "$(CURDIR):/release:z" registry.svc.ci.openshift.org/ci/dashboards-validation:latest make -C /release/clusters/app.ci/prow-monitoring/mixins install all
.PHONY: mixins