Skip to content

Commit

Permalink
Merge pull request #880 from rnc/APH1
Browse files Browse the repository at this point in the history
Integrate maven repo deployment code
  • Loading branch information
stuartwdouglas authored Oct 23, 2023
2 parents d8a3449 + 0f7545e commit 0501788
Show file tree
Hide file tree
Showing 19 changed files with 547 additions and 275 deletions.
6 changes: 4 additions & 2 deletions deploy/base-development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
DIR=`dirname $0`
kubectl apply -f $DIR/namespace.yaml
kubectl config set-context --current --namespace=test-jvm-namespace
kubectl delete --ignore-not-found secret jvm-build-image-secrets jvm-build-git-secrets
kubectl delete --ignore-not-found secret jvm-build-image-secrets jvm-build-git-secrets jvm-build-maven-repo-secrets

if [ -n "$QUAY_ORG" ] && [ -n "$QUAY_TOKEN" ]; then
kubectl delete --ignore-not-found secret -n image-controller quaytoken
Expand All @@ -28,10 +28,12 @@ kubectl create secret generic jvm-build-git-secrets --from-literal .git-credenti
https://$GITHUB_E2E_ORGANIZATION:$GITHUB_TOKEN@github.com
https://test:[email protected]
"
if [ -n "$MAVEN_PASSWORD" ]; then
kubectl create secret generic jvm-build-maven-repo-secrets --from-literal mavenpassword="$MAVEN_PASSWORD"
fi

JVM_BUILD_SERVICE_IMAGE=quay.io/$QUAY_USERNAME/hacbs-jvm-controller \
JVM_BUILD_SERVICE_CACHE_IMAGE=quay.io/$QUAY_USERNAME/hacbs-jvm-cache \
JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE=quay.io/$QUAY_USERNAME/hacbs-jvm-build-request-processor:dev \
$DIR/patch-yaml.sh
kubectl apply -k $DIR/overlays/development

7 changes: 7 additions & 0 deletions deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ spec:
additionalProperties:
type: string
type: object
mavenDeployment:
properties:
repository:
type: string
username:
type: string
type: object
owner:
type: string
port:
Expand Down
7 changes: 4 additions & 3 deletions deploy/overlays/ci-template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: JBSConfig
metadata:
name: jvm-build-config
spec:
owner: QUAY_USERNAME
host: quay.io
repository: test-images
registry:
owner: QUAY_USERNAME
host: quay.io
repository: test-images
6 changes: 5 additions & 1 deletion deploy/overlays/dev-template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ kind: JBSConfig
metadata:
name: jvm-build-config
spec:
owner: QUAY_USERNAME
registry:
owner: QUAY_USERNAME
mavenDeployment:
username: MAVEN_USERNAME
repository: MAVEN_REPOSITORY
relocationPatterns:
- relocationPattern:
buildPolicy: "default"
Expand Down
8 changes: 8 additions & 0 deletions deploy/patch-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ find $DIR -path \*development\*.yaml -exec $SED -i s%jvm-build-service-cache-ima
find $DIR -path \*development\*.yaml -exec $SED -i s%jvm-build-service-reqprocessor-image%${JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE}% {} \;
find $DIR -path \*development\*.yaml -exec $SED -i s/dev-template/development/ {} \;
find $DIR -path \*development\*.yaml -exec $SED -i s/QUAY_TOKEN/${QUAY_TOKEN}/ {} \;
if [ -z "${MAVEN_USERNAME}" ]; then
MAVEN_USERNAME=""
fi
if [ -z "${MAVEN_REPOSITORY}" ]; then
MAVEN_REPOSITORY=""
fi
find $DIR -path \*development\*.yaml -exec $SED -i s/MAVEN_USERNAME/${MAVEN_USERNAME}/ {} \;
find $DIR -path \*development\*.yaml -exec $SED -i s%MAVEN_REPOSITORY%${MAVEN_REPOSITORY}% {} \;
if [ -n "$QUAY_TOKEN" ]; then
$SED -i '/owner: QUAY_USERNAME/d' $DIR/overlays/development/config.yaml
fi
Expand Down
90 changes: 24 additions & 66 deletions java-components/build-request-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,19 @@
</parent>
<artifactId>hacbs-build-request-processor</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.amazonservices</groupId>
<artifactId>quarkus-amazon-s3</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>url-connection-client</artifactId>
</dependency>
<dependency>
<groupId>io.github.redhat-appstudio.jvmbuild</groupId>
<artifactId>hacbs-classfile-tracker</artifactId>
</dependency>
<dependency>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-core-java</artifactId>
<groupId>io.github.redhat-appstudio.jvmbuild</groupId>
<artifactId>hacbs-build-recipies-database</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<groupId>io.github.redhat-appstudio.jvmbuild</groupId>
<artifactId>hacbs-resource-model</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
Expand All @@ -45,10 +34,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-jib</artifactId>
</dependency>
<dependency>
<groupId>io.github.redhat-appstudio.jvmbuild</groupId>
<artifactId>hacbs-resource-model</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-picocli</artifactId>
Expand All @@ -58,29 +43,40 @@
<artifactId>quarkus-jgit</artifactId>
</dependency>
<dependency>
<groupId>io.github.redhat-appstudio.jvmbuild</groupId>
<artifactId>hacbs-build-recipies-database</artifactId>
<groupId>io.quarkiverse.mavenresolver</groupId>
<artifactId>quarkus-maven-resolver</artifactId>
</dependency>

<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-core-java</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
</dependency>

<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-tooling-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<groupId>org.apache.maven.indexer</groupId>
<artifactId>indexer-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand All @@ -91,54 +87,16 @@
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>localstack</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.indexer</groupId>
<artifactId>indexer-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Loading

0 comments on commit 0501788

Please sign in to comment.