Skip to content

Commit 697c8eb

Browse files
committed
Add quay repo
1 parent 19b7c25 commit 697c8eb

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

deploy/pipeline/mw-pipeline-v0.1.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ metadata:
44
name: mw-pipeline
55
spec:
66
params:
7+
- name: QUAY_REPO
8+
type: string
79
- name: URL
810
description: Repository URL to clone from
911
type: string
@@ -73,8 +75,7 @@ spec:
7375
- git-clone
7476
params:
7577
- name: IMAGE_URL
76-
# value: 'quay.io/redhat-user-workloads-stage/pnc-devel-tenant/pnc-konflux-trusted-source:{{revision}}'
77-
value: 'quay.io/redhat-user-workloads-stage/pnc-devel-tenant/pnc:trusted-source-$(context.pipelineRun.name)'
78+
value: $(params.QUAY_REPO):trusted-source-$(context.pipelineRun.name)
7879
- name: NAME
7980
value: $(context.pipelineRun.name)
8081
- name: RECIPE_IMAGE
@@ -110,7 +111,7 @@ spec:
110111
- name: HERMETIC
111112
value: "false"
112113
- name: IMAGE # output image
113-
value: quay.io/redhat-user-workloads-stage/pnc-devel-tenant/pnc:build-$(context.pipelineRun.name)
114+
value: $(params.QUAY_REPO):build-$(context.pipelineRun.name)
114115
- name: DOCKERFILE # local path to the containerfile
115116
value: .jbs/Containerfile
116117
- name: caTrustConfigMapName

deploy/tasks/maven-deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ spec:
2929
- name: MVN_PASSWORD
3030
description: Name of the secret holding the Maven repository password
3131
type: string
32+
# https://github.com/tektoncd/pipeline/issues/8249
3233
default: ""
3334
- name: MVN_SERVER_ID
3435
description: Server identification in Maven settings.

deploy/tasks/pre-build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ spec:
8080
cpu: 10m
8181
memory: 512Mi
8282
script: |
83+
ls -lR $(workspaces.source.path)
8384
/opt/jboss/container/java/run/run-java.sh $(params.BUILD_TOOL)-prepare --java-version=$(params.JAVA_VERSION) --build-tool-version=$(params.BUILD_TOOL_VERSION) --recipe-image=$(params.RECIPE_IMAGE) --request-processor-image=$(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE) --disabled-plugins=$(params.BUILD_PLUGINS) $(workspaces.source.path)/source
8485
env:
8586
- name: BUILD_SCRIPT
@@ -117,6 +118,7 @@ spec:
117118
- name: create-pre-build-image
118119
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:52f1391e6f1c472fd10bb838f64fae2ed3320c636f536014978a5ddbdfc6b3af
119120
script: |
121+
ls -lR $(workspaces.source.path)
120122
echo "Creating pre-build-image archive"
121123
create-archive --store $(params.IMAGE_URL) $(results.PRE_BUILD_IMAGE_DIGEST.path)=$(workspaces.source.path)/source
122124
env:

java-components/cli/src/main/java/com/redhat/hacbs/cli/driver/Pipeline.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ public class Pipeline extends Base implements Runnable {
2121
@Inject
2222
Driver driver;
2323

24+
@CommandLine.Option(names = "-q", description = "Quay repo", defaultValue = "quay.io/redhat-user-workloads-stage/pnc-devel-tenant/pnc")
25+
String quayRepo;
26+
2427
@ActivateRequestContext // https://github.com/quarkusio/quarkus/issues/8758
2528
@Override
2629
public void run() {
2730
logger.info("### in here with driver {}", driver);
28-
driver.addAccessToken(accessToken.orElse("NO_TOKEN"));
31+
driver.addValues(accessToken.orElse("NO_TOKEN"), quayRepo);
2932

3033
BuildRequest request = BuildRequest.builder()
3134
.namespace(namespace)

java-components/driver/src/main/java/com/redhat/hacbs/driver/Driver.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ public class Driver {
4646
ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory());
4747

4848
private String accessToken;
49+
private String quayRepo;
4950

50-
public void addAccessToken(String accessToken) {
51-
System.err.println("### oidc " + oidcClient);
51+
public void addValues(String accessToken, String quayRepo) {
5252
this.accessToken = accessToken;
53+
this.quayRepo = quayRepo;
5354
}
5455

5556
public void create(BuildRequest buildRequest) throws IOException {
@@ -62,6 +63,7 @@ public void create(BuildRequest buildRequest) throws IOException {
6263
}
6364

6465
Map<String, String> templateProperties = new HashMap<>();
66+
templateProperties.put("QUAY_REPO", quayRepo);
6567
templateProperties.put("URL", buildRequest.getScmUrl());
6668
templateProperties.put("REVISION", buildRequest.getScmRevision());
6769
templateProperties.put("BUILD_TOOL", buildRequest.getBuildTool());

java-components/driver/src/main/resources/pipeline.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ spec:
2626
storage: 1Gi
2727
status: {}
2828
params:
29+
- name: QUAY_REPO
30+
value: "%{QUAY_REPO}"
2931
- name: URL
3032
value: "%{URL}"
3133
- name: REVISION

0 commit comments

Comments
 (0)