From 66e8a96f6c8743408dd57a833b03a39881d38fa3 Mon Sep 17 00:00:00 2001 From: Robert Baumgartner Date: Fri, 3 Sep 2021 15:02:29 +0200 Subject: [PATCH 1/2] some updates for OpenShift Pipeline 1.5 --- cd/gogs.yaml | 4 ++-- cd/nexus.yaml | 4 ++-- cd/reports-repo.yaml | 4 ++-- cd/sonarqube.yaml | 4 ++-- pipelines/pipeline-deploy-dev.yaml | 7 +++---- triggers/eventlistener.yaml | 4 ++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/cd/gogs.yaml b/cd/gogs.yaml index 86216ff..eb2378f 100644 --- a/cd/gogs.yaml +++ b/cd/gogs.yaml @@ -166,7 +166,7 @@ spec: type: ClusterIP --- kind: Route -apiVersion: v1 +apiVersion: route.openshift.io/v1 id: gogs-http metadata: labels: @@ -200,4 +200,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 1Gi \ No newline at end of file + storage: 1Gi diff --git a/cd/nexus.yaml b/cd/nexus.yaml index 3a6f00d..239b0ee 100644 --- a/cd/nexus.yaml +++ b/cd/nexus.yaml @@ -81,7 +81,7 @@ spec: sessionAffinity: None type: ClusterIP --- -apiVersion: v1 +apiVersion: route.openshift.io/v1 kind: Route metadata: labels: @@ -106,4 +106,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 5Gi \ No newline at end of file + storage: 5Gi diff --git a/cd/reports-repo.yaml b/cd/reports-repo.yaml index 703c5c7..0979625 100644 --- a/cd/reports-repo.yaml +++ b/cd/reports-repo.yaml @@ -91,7 +91,7 @@ spec: app: reports-repo deployment: reports-repo --- -apiVersion: v1 +apiVersion: route.openshift.io/v1 kind: Route metadata: labels: @@ -116,4 +116,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 5Gi \ No newline at end of file + storage: 5Gi diff --git a/cd/sonarqube.yaml b/cd/sonarqube.yaml index 5f6a390..59f24ac 100644 --- a/cd/sonarqube.yaml +++ b/cd/sonarqube.yaml @@ -78,7 +78,7 @@ spec: - name: sonarqube-logs emptyDir: {} --- -apiVersion: v1 +apiVersion: route.openshift.io/v1 kind: Route metadata: labels: @@ -110,4 +110,4 @@ spec: selector: app: sonarqube name: sonarqube - type: ClusterIP \ No newline at end of file + type: ClusterIP diff --git a/pipelines/pipeline-deploy-dev.yaml b/pipelines/pipeline-deploy-dev.yaml index 8ae20a6..5d577a3 100644 --- a/pipelines/pipeline-deploy-dev.yaml +++ b/pipelines/pipeline-deploy-dev.yaml @@ -54,7 +54,7 @@ spec: taskRef: name: maven runAfter: - - source-clone + - dependency-report workspaces: - name: source workspace: workspace @@ -67,7 +67,7 @@ spec: taskRef: name: maven runAfter: - - source-clone + - dependency-report workspaces: - name: source workspace: workspace @@ -101,7 +101,6 @@ spec: name: maven runAfter: - code-analysis - - dependency-report - unit-tests workspaces: - name: source @@ -214,4 +213,4 @@ spec: workspaces: - name: simulations workspace: workspace - subPath: spring-petclinic-gatling \ No newline at end of file + subPath: spring-petclinic-gatling diff --git a/triggers/eventlistener.yaml b/triggers/eventlistener.yaml index f8fe398..64d7891 100644 --- a/triggers/eventlistener.yaml +++ b/triggers/eventlistener.yaml @@ -17,7 +17,7 @@ spec: bindings: - ref: gogs-triggerbinding template: - name: petclinic-trigger-template + ref: petclinic-trigger-template --- apiVersion: route.openshift.io/v1 kind: Route @@ -29,7 +29,7 @@ metadata: eventlistener: webhook spec: port: - targetPort: 8080 + targetPort: 8000 to: kind: "Service" name: el-webhook From 5d996c9ffc76e5157d4abb0f1219242c86142739 Mon Sep 17 00:00:00 2001 From: Robert Baumgartner Date: Thu, 17 Mar 2022 16:38:27 +0100 Subject: [PATCH 2/2] Update to use Nexus 3.38 due to some CVEs --- cd/nexus.yaml | 2 +- demo.sh | 7 ++++++- triggers/eventlistener.yaml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cd/nexus.yaml b/cd/nexus.yaml index 239b0ee..eace910 100644 --- a/cd/nexus.yaml +++ b/cd/nexus.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: nexus - image: quay.io/siamaksade/nexus3:3.16.2 + image: quay.io/rbaumgar/nexus3:3.38.0 env: - name: CONTEXT_PATH value: / diff --git a/demo.sh b/demo.sh index 3471b15..95b5bc3 100755 --- a/demo.sh +++ b/demo.sh @@ -105,7 +105,11 @@ command.install() { oc rollout status deployment/gogs -n $cicd_prj oc create -f config/gogs-init-taskrun.yaml -n $cicd_prj - oc project $cicd_prj + oc project $cicd_prj + + info "Wait for Nexus to be ready" + oc wait --for=condition=ready `oc get pod -o name|grep nexus-` --timeout=300s + NEXUS_PASSWORD=$(oc rsh deployment/nexus cat /nexus-data/admin.password) cat <<-EOF @@ -132,6 +136,7 @@ command.install() { Reports Server: http://$(oc get route reports-repo -o template --template='{{.spec.host}}' -n $cicd_prj) SonarQube: https://$(oc get route sonarqube -o template --template='{{.spec.host}}' -n $cicd_prj) Sonatype Nexus: http://$(oc get route nexus -o template --template='{{.spec.host}}' -n $cicd_prj) + password: $NEXUS_PASSWORD ############################################################################ ############################################################################ diff --git a/triggers/eventlistener.yaml b/triggers/eventlistener.yaml index 64d7891..99072f0 100644 --- a/triggers/eventlistener.yaml +++ b/triggers/eventlistener.yaml @@ -29,7 +29,7 @@ metadata: eventlistener: webhook spec: port: - targetPort: 8000 + targetPort: 8080 to: kind: "Service" name: el-webhook