From 3f1452133cbf67e5db9aa707008f80e1b9122e38 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Wed, 21 Jun 2023 12:41:07 +0200 Subject: [PATCH] feat(e2e): enable maven proxy It should speed up execution --- .../actions/kamel-config-cluster/action.yaml | 13 +++++ .../actions/kamel-config-cluster/nexus.yaml | 49 +++++++++++++++++++ e2e/support/test_nexus_hooks.go | 2 +- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/actions/kamel-config-cluster/nexus.yaml diff --git a/.github/actions/kamel-config-cluster/action.yaml b/.github/actions/kamel-config-cluster/action.yaml index 64e5c377a8..7e755a1c66 100644 --- a/.github/actions/kamel-config-cluster/action.yaml +++ b/.github/actions/kamel-config-cluster/action.yaml @@ -164,6 +164,19 @@ runs: echo "Complete" + # + # Install a Maven Proxy repository + # + - id: install-maven-proxy + name: Install Maven proxy repository + shell: bash + run: | + kubectl create namespace nexus + kubectl apply -f ./.github/actions/kamel-config-cluster/nexus.yaml -n nexus + kubectl rollout status deployment nexus -n nexus --timeout=180s + echo "TEST_ENABLE_NEXUS=true" >> $GITHUB_OUTPUT + echo "Maven proxy repository up and running!" + outputs: cluster-image-registry-push-host: description: "The image registry to which to push images" diff --git a/.github/actions/kamel-config-cluster/nexus.yaml b/.github/actions/kamel-config-cluster/nexus.yaml new file mode 100644 index 0000000000..3fed9b6ea0 --- /dev/null +++ b/.github/actions/kamel-config-cluster/nexus.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Service +metadata: + name: nexus +spec: + selector: + app: nexus + ports: + - protocol: TCP + port: 80 + targetPort: 8081 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nexus +spec: + selector: + matchLabels: + app: nexus + template: + metadata: + labels: + app: nexus + spec: + containers: + - name: nexus + image: sonatype/nexus3 + ports: + - containerPort: 8081 + name: 8081-tcp + livenessProbe: + httpGet: + path: /service/rest/v1/status + port: 8081 + initialDelaySeconds: 90 + periodSeconds: 3 + readinessProbe: + httpGet: + path: /service/rest/v1/status + port: 8081 + initialDelaySeconds: 90 + periodSeconds: 3 + volumeMounts: + - name: nexus-data + mountPath: /nexus-data + volumes: + - name: nexus-data + emptyDir: {} \ No newline at end of file diff --git a/e2e/support/test_nexus_hooks.go b/e2e/support/test_nexus_hooks.go index 81aaeb988f..819d694559 100644 --- a/e2e/support/test_nexus_hooks.go +++ b/e2e/support/test_nexus_hooks.go @@ -34,7 +34,7 @@ import ( const ( nexusNamespace = "nexus" nexusService = "nexus" - nexusMavenMirror = "http://nexus.nexus/repository/maven-public/@id=nexus@mirrorOf=central" + nexusMavenMirror = "http://nexus.nexus/@id=nexus@mirrorOf=*" ) func init() {