Skip to content

Commit 60dffab

Browse files
authored
Merge pull request #2000 from tecarter94/maven-repo-for-testing
Run reposilite and deploy to during minikube pipeline
2 parents ce487a4 + 79cd846 commit 60dffab

File tree

66 files changed

+8394
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+8394
-8
lines changed

.github/workflows/minikube.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
export QUAY_USERNAME=minikube
6868
export DEV_IP=172.16.1.1
6969
export JBS_WORKER_NAMESPACE=jvm-build-service-test-namespace-$(shuf -er -n5 {a..z} {0..9} | tr -d '\n')
70+
export MAVEN_USERNAME=admin
71+
export MAVEN_PASSWORD=secret
72+
export MAVEN_REPOSITORY='http://jvm-build-maven-repo.$(context.taskRun.namespace).svc.cluster.local/releases'
7073
7174
eval $(minikube -p minikube docker-env)
7275
@@ -125,6 +128,9 @@ jobs:
125128
export QUAY_USERNAME=minikube
126129
export DEV_IP=172.16.1.1
127130
export JBS_WORKER_NAMESPACE=jvm-build-service-test-namespace-$(shuf -er -n5 {a..z} {0..9} | tr -d '\n')
131+
export MAVEN_USERNAME=admin
132+
export MAVEN_PASSWORD=secret
133+
export MAVEN_REPOSITORY='http://jvm-build-maven-repo.$(context.taskRun.namespace).svc.cluster.local/releases'
128134
129135
eval $(minikube -p minikube docker-env)
130136

deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ spec:
116116
type: object
117117
mavenDeployment:
118118
properties:
119+
onlyDeploy:
120+
type: boolean
119121
repository:
120122
type: string
121123
username:

deploy/maven-repo.yaml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: jvm-build-maven-repo
5+
namespace: test-jvm-namespace
6+
spec:
7+
revisionHistoryLimit: 0
8+
strategy:
9+
type: Recreate
10+
selector:
11+
matchLabels:
12+
app: jvm-build-maven-repo
13+
template:
14+
metadata:
15+
labels:
16+
app: jvm-build-maven-repo
17+
spec:
18+
serviceAccountName: pipeline
19+
securityContext:
20+
runAsUser: 0
21+
containers:
22+
- name: jvm-build-maven-repo
23+
image: ${REPOSILITE_IMAGE}
24+
imagePullPolicy: IfNotPresent
25+
ports:
26+
- name: http
27+
containerPort: 8080
28+
protocol: TCP
29+
resources:
30+
requests:
31+
memory: 256Mi
32+
cpu: 100m
33+
limits:
34+
memory: 256Mi
35+
cpu: 100m
36+
startupProbe:
37+
failureThreshold: 120
38+
periodSeconds: 1
39+
httpGet:
40+
path: /
41+
port: 8080
42+
scheme: HTTP
43+
livenessProbe:
44+
failureThreshold: 3
45+
periodSeconds: 5
46+
httpGet:
47+
path: /
48+
port: 8080
49+
scheme: HTTP
50+
env:
51+
- name: REPOSILITE_OPTS
52+
value: "--token ${MAVEN_USERNAME}:${MAVEN_PASSWORD}"
53+
---
54+
apiVersion: v1
55+
kind: Service
56+
metadata:
57+
name: jvm-build-maven-repo
58+
namespace: test-jvm-namespace
59+
spec:
60+
ports:
61+
- name: http
62+
protocol: TCP
63+
port: 80
64+
targetPort: 8080
65+
type: ClusterIP
66+
selector:
67+
app: jvm-build-maven-repo
68+
---
69+
kind: Route
70+
apiVersion: route.openshift.io/v1
71+
metadata:
72+
name: maven-repo
73+
namespace: test-jvm-namespace
74+
labels:
75+
app: jvm-build-maven-repo
76+
annotations:
77+
openshift.io/host.generated: 'true'
78+
spec:
79+
to:
80+
kind: Service
81+
name: jvm-build-maven-repo
82+
weight: 100
83+
port:
84+
targetPort: http
85+
tls:
86+
termination: edge
87+
insecureEdgeTerminationPolicy: Redirect
88+
wildcardPolicy: None
89+

deploy/openshift-development.sh

+21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
#!/bin/sh
22

3+
deploy_maven_repo=false
4+
5+
if [ -z "$MAVEN_USERNAME" ]; then
6+
export MAVEN_USERNAME=admin
7+
deploy_maven_repo=true
8+
fi
9+
if [ -z "$MAVEN_PASSWORD" ]; then
10+
export MAVEN_PASSWORD=secret
11+
deploy_maven_repo=true
12+
fi
13+
if [ -z "$MAVEN_REPOSITORY" ]; then
14+
export MAVEN_REPOSITORY='http://jvm-build-maven-repo.$(context.taskRun.namespace).svc.cluster.local/releases'
15+
deploy_maven_repo=true
16+
fi
17+
318
DIR=`dirname $0`
419
$DIR/base-development.sh $1
20+
21+
if [ "$deploy_maven_repo" = true ]; then
22+
export REPOSILITE_IMAGE=$(sed -n 's/^FROM //p' $DIR/../openshift-with-appstudio-test/e2e/Dockerfile.reposilite)
23+
kubectl delete --ignore-not-found deployment,service,route jvm-build-maven-repo maven-repo -n test-jvm-namespace
24+
cat $DIR/maven-repo.yaml | envsubst '${MAVEN_PASSWORD} ${MAVEN_USERNAME} ${REPOSILITE_IMAGE}' | kubectl create -f -
25+
fi

deploy/overlays/dev-template/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
mavenDeployment:
1515
username: ${MAVEN_USERNAME}
1616
repository: ${MAVEN_REPOSITORY}
17+
onlyDeploy: true
1718
gitSourceArchive:
1819
identity: ${GIT_DEPLOY_IDENTITY}
1920
url: ${GIT_DEPLOY_URL}

go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ require (
3131
sigs.k8s.io/yaml v1.4.0
3232
)
3333

34+
require github.com/swist/go-k8s-portforward v0.2.1
35+
3436
require (
3537
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
3638
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
@@ -87,11 +89,13 @@ require (
8789
github.com/mattn/go-isatty v0.0.20 // indirect
8890
github.com/mattn/go-runewidth v0.0.15 // indirect
8991
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
92+
github.com/moby/spdystream v0.2.0 // indirect
9093
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
9194
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
9295
github.com/modern-go/reflect2 v1.0.2 // indirect
9396
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
9497
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
98+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
9599
github.com/nsf/termbox-go v1.1.1 // indirect
96100
github.com/opencontainers/go-digest v1.0.0 // indirect
97101
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect

go.sum

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V
6262
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
6363
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
6464
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
65+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
6566
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
6667
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
6768
github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI=
@@ -374,6 +375,7 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyex
374375
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
375376
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
376377
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
378+
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
377379
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
378380
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
379381
github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
@@ -391,6 +393,7 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
391393
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
392394
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
393395
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
396+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
394397
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
395398
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
396399
github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
@@ -512,6 +515,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
512515
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
513516
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
514517
github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc=
518+
github.com/swist/go-k8s-portforward v0.2.1 h1:g05bb6ga8bNMS06SQTsncBl8PYWWw3Xhv/HouuBqXmQ=
519+
github.com/swist/go-k8s-portforward v0.2.1/go.mod h1:03UIdxC0VkvjjJ2Hp2UenhvZmXVVJfHBBK9GR6Pa1+A=
515520
github.com/tektoncd/cli v0.37.0 h1:C+1/N+cGwj3ClIH9An2FggoplQ36zID7+5I0q03lrF0=
516521
github.com/tektoncd/cli v0.37.0/go.mod h1:RageyyvtjqucJ5l0yPInjHCgdyf8Tz7EFZXFjv6ROGQ=
517522
github.com/tektoncd/pipeline v0.59.2 h1:hspD31XWToUIFnUFkUitjqGBnW0hd9Q9cVHYbhjphi0=

java-components/resource-model/src/main/resources/crds/jvmbuildservice.io_jbsconfigs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ spec:
116116
type: object
117117
mavenDeployment:
118118
properties:
119+
onlyDeploy:
120+
type: boolean
119121
repository:
120122
type: string
121123
username:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#This file is used to enable renovate to update the digests. It is updated by renovate then substituted into the golang code.
2+
3+
FROM dzikoysk/reposilite:latest@sha256:4ed47bf26fe7a2d1091de09c8647295605ba52a9af7913ca99e8ed8126b49a16

0 commit comments

Comments
 (0)