Skip to content

Commit

Permalink
chore(deps): build without custom tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
  • Loading branch information
ruromero committed May 8, 2024
1 parent 517d3ef commit 7e50a62
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 43 deletions.
34 changes: 5 additions & 29 deletions .tekton/exhort-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,34 +199,6 @@ spec:
workspaces:
- name: source
workspace: workspace
- name: copy-settings
runAfter:
- clone-repository
taskSpec:
steps:
- name: copy
image: registry.access.redhat.com/ubi9/ubi-minimal:9.4
script: |
#!/bin/sh
set -x
cp $(workspaces.settings.path)/settings.xml $(workspaces.workspace.path)/source/settings.xml
workspaces:
- name: settings
workspace: mvn-settings
- name: workspace
workspace: workspace
- name: run-tests
runAfter:
- prefetch-dependencies
- copy-settings
taskRef:
name: openjdk-redis-6gb
params:
- name: SCRIPT
value: mvn -B --settings settings.xml verify -Dquarkus.redis.hosts=redis://localhost/
workspaces:
- name: source
workspace: workspace
- name: build-container
params:
- name: IMAGE
Expand All @@ -243,8 +215,12 @@ spec:
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS_FILE
value: ../../../entitlement/gh-creds.txt
- name: ENTITLEMENT_SECRET
value: gh-credentials
runAfter:
- run-tests
- clone-repository
taskRef:
params:
- name: name
Expand Down
18 changes: 5 additions & 13 deletions .tekton/exhort-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,6 @@ spec:
workspace: mvn-settings
- name: workspace
workspace: workspace
- name: run-tests
runAfter:
- prefetch-dependencies
- copy-settings
taskRef:
name: openjdk-redis-6gb
params:
- name: SCRIPT
value: mvn -B --settings settings.xml verify -Dquarkus.redis.hosts=redis://localhost/
workspaces:
- name: source
workspace: workspace
- name: build-container
params:
- name: IMAGE
Expand All @@ -237,8 +225,12 @@ spec:
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS_FILE
value: ../../../entitlement/gh-creds.txt
- name: ENTITLEMENT_SECRET
value: gh-credentials
runAfter:
- run-tests
- clone-repository
taskRef:
params:
- name: name
Expand Down
36 changes: 36 additions & 0 deletions .tekton/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/RHEcosystemAppEng/exhort-api-spec</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.GH_USER}</username>
<password>${env.GH_TOKEN}</password>
</server>
</servers>
</settings>
8 changes: 7 additions & 1 deletion src/main/docker/Dockerfile.jvm.staged
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ USER root
WORKDIR /build

## Maven Settings with the auth token for Github Maven Repository
COPY settings.xml settings.xml
COPY .tekton/settings.xml settings.xml
COPY pom.xml .
COPY ui ui

ARG GH_USER
ARG GH_TOKEN

ENV GH_USER=$GH_USER
ENV GH_TOKEN=$GH_TOKEN

RUN mvn -B --settings settings.xml org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline

COPY src src
Expand Down

0 comments on commit 7e50a62

Please sign in to comment.