Skip to content

Commit 992b859

Browse files
committed
create a new ci flow that is a subset of the kustomize dev flow
1 parent df3101b commit 992b859

File tree

7 files changed

+103
-6
lines changed

7 files changed

+103
-6
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ nb-configuration.xml
4141
.envrc
4242
*.out
4343

44-
# Kustomize overlays for development
45-
deploy/**/development/**
44+
# Kustomize overlays for development, openshift ci
45+
deploy/**/development/**
46+
deploy/**/ci-final/**

deploy/openshift-ci.sh

+27-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,33 @@
22

33
echo "Executing openshift-ci.sh"
44

5+
echo "jvm build service golang operator image:"
6+
echo ${JVM_BUILD_SERVICE_IMAGE}
7+
echo "jvm build service jvm cache image:"
8+
echo ${JVM_BUILD_SERVICE_CACHE_IMAGE}
9+
echo "jvm build service jvm sidecar image:"
10+
echo ${JVM_BUILD_SERVICE_SIDECAR_IMAGE}
11+
echo "jvm build service jvm analyzer image:"
12+
echo ${JVM_BUILD_SERVICE_ANALYZER_IMAGE}
13+
echo "jvm build service jvm reqprocessor image:"
14+
echo ${JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE}
15+
516
DIR=`dirname $0`
617
echo "Running out of ${DIR}"
718
$DIR/install-openshift-pipelines.sh
8-
oc apply -f $DIR/namespace.yaml
9-
$DIR/patch-yaml.sh
10-
oc apply -k $DIR/overlays/development
11-
19+
oc create ns jvm-build-service || true
20+
find $DIR -name ci-final -exec rm -r {} \;
21+
find $DIR -name ci-template -exec cp -r {} {}/../ci-final \;
22+
# copy this over since if updates more frequently
23+
cp $DIR/base/system-config.yaml $DIR/overlays/ci-final/system-config-builders.yaml
24+
find $DIR -path \*ci-final\*.yaml -exec sed -i s%jvm-build-service-image%${JVM_BUILD_SERVICE_IMAGE}% {} \;
25+
find $DIR -path \*ci-final\*.yaml -exec sed -i s%jvm-build-service-cache-image%${JVM_BUILD_SERVICE_CACHE_IMAGE}% {} \;
26+
find $DIR -path \*ci-final\*.yaml -exec sed -i s%jvm-build-service-sidecar-image%${JVM_BUILD_SERVICE_SIDECAR_IMAGE}% {} \;
27+
find $DIR -path \*ci-final\*.yaml -exec sed -i s%jvm-build-service-analyzer-image%${JVM_BUILD_SERVICE_ANALYZER_IMAGE}% {} \;
28+
find $DIR -path \*ci-final\*.yaml -exec sed -i s%jvm-build-service-reqprocessor-image%${JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE}% {} \;
29+
find $DIR -path \*ci-final\*.yaml -exec sed -i s/ci-template/ci-final/ {} \;
30+
oc apply -k $DIR/crds/base
31+
oc apply -f $DIR/operator/base/sa.yaml
32+
oc apply -f $DIR/operator/base/rbac.yaml
33+
oc apply -k $DIR/operator/overlays/ci-final
34+
oc apply -k $DIR/overlays/ci-final
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: hacbs-jvm-operator
5+
namespace: jvm-build-service
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: hacbs-jvm-operator
11+
template:
12+
metadata:
13+
labels:
14+
app: hacbs-jvm-operator
15+
spec:
16+
containers:
17+
- name: hacbs-jvm-operator
18+
image: jvm-build-service-image
19+
imagePullPolicy: Always
20+
env:
21+
- name: RECIPE_DATABASE
22+
value: "https://github.com/redhat-appstudio/jvm-build-data"
23+
resources:
24+
requests:
25+
memory: "256Mi"
26+
cpu: "500m"
27+
limits:
28+
memory: "256Mi"
29+
cpu: "500m"
30+
serviceAccountName: hacbs-jvm-operator
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- operator-images.yaml
6+
7+
patchesStrategicMerge:
8+
# this is a copy of deploy/operator/base/deployment.yaml, but needed because image substitution works differently in CI vs. dev flow,
9+
# and I'm bypassing that gross env var munging we had to do in infra-deps; also, the deployment yaml should be pretty static at this point
10+
- base-deployment.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: hacbs-jvm-operator
5+
namespace: jvm-build-service
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: hacbs-jvm-operator
11+
env:
12+
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
13+
value: jvm-build-service-reqprocessor-image
14+
- name: JVM_BUILD_SERVICE_SIDECAR_IMAGE
15+
value: jvm-build-service-sidecar-image
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- system-config.yaml
6+
7+
patchesStrategicMerge:
8+
# see copy from openshift-ci.sh of deploy/base/system-config.yaml
9+
- system-config-builders.yaml
10+
- https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service-builder-images/fbe0f42ebe3d50b16d454c95207dd15be6b5008f/image-config.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: jvm-build-system-config
6+
namespace: jvm-build-service
7+
data:
8+
image.cache: jvm-build-service-cache-image

0 commit comments

Comments
 (0)