Compare commits

...

5 Commits

Author SHA1 Message Date
Jonathan Christison 5ca4917bf4 Fix app properties service account reference 3 years ago
Jonathan Christison f66b910de7 Use SA in general profile 3 years ago
Jonathan Christison 7d61509b12 Changing this to Blocking as the vertx thread is timing out 3 years ago
Jonathan Christison 69445ad0d4 Use stage env DB setup 3 years ago
Jonathan Christison bfd887c40e Add hack/examples of calling single endpoints 3 years ago
  1. 9
      hack/single-brew-scan-stage.sh
  2. 10
      hack/single-git-scan-stage.sh
  3. 5
      src/main/java/com/redhat/pctsec/tekton/TaskHandler.java
  4. 7
      src/main/resources/application.properties

9
hack/single-brew-scan-stage.sh

@ -0,0 +1,9 @@
#!/bin/bash
curl --get \
--data-urlencode "brewId=xterm-366-8.el9" \
https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/single/brew -vv
curl --get https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/2 -vv
curl --get https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/2/run -vv

10
hack/single-git-scan-stage.sh

@ -0,0 +1,10 @@
#!/bin/bash
curl --get \
--data-urlencode "repo=https://code.engineering.redhat.com/gerrit/quarkusio/quarkus.git" \
--data-urlencode "ref=2.13.8.Final-redhat-00001" \
https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/single/git -vv
curl --get https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/1 -vv
curl --get https://osh-pct-security-tooling.apps.ocp-c1.prod.psi.redhat.com/api/v1a/Scan/1/run -vv

5
src/main/java/com/redhat/pctsec/tekton/TaskHandler.java

@ -14,6 +14,7 @@ import io.fabric8.tekton.pipeline.v1beta1.*;
import io.quarkus.vertx.ConsumeEvent;
import io.smallrye.common.annotation.Blocking;
import jakarta.inject.Inject;
import org.apache.commons.lang3.RandomStringUtils;
@ -34,9 +35,11 @@ public class TaskHandler {
@ConfigProperty(name = "tekton.task.ref")
String TASK_REFERENCE;
@Inject TektonClient tektonClient;
@Inject
TektonClient tektonClient;
@ConsumeEvent("tekton")
@Blocking
public ScanTask consume(ScanTask scanTask)
{

7
src/main/resources/application.properties

@ -33,9 +33,10 @@
%stage.quarkus.kubernetes-config.secrets.enabled=true
quarkus.kubernetes-config.secrets=postgresql
%stage.quarkus.datasource.jdbc.url=postgresql://postgresql:5432/${database-name}
%stage.quarkus.datasource.jdbc.url=jdbc:postgresql://postgresql:5432/${database-name}
%stage.quarkus.datasource.username=${database-user}
%stage.quarkus.datasource.password=${database-password}
%stage.quarkus.hibernate-orm.database.generation=drop-and-create
#Always provide swagger ui
@ -44,7 +45,7 @@ quarkus.swagger-ui.always-include=true
%dev.quarkus.openshift.namespace=pct-security-tooling
%stage.quarkus.openshift.name=osh
%stage.quarkus.openshift.service-account=osh-wrapper-client-sa
quarkus.openshift.service-account=osh-wrapper-client-sa
%stage.quarkus.openshift.labels.env=stage
%stage.quarkus.log.level=DEBUG
quarkus.arc.remove-unused-beans=false
@ -77,7 +78,7 @@ quarkus.arc.remove-unused-beans=false
##########################################
tekton.pipeline.ref=osh-client-from-source
tekton.task.ref=osh-scan-task
tekton.service-account=${%stage.quarkus.openshift.service-account}
tekton.service-account=${quarkus.openshift.service-account}

Loading…
Cancel
Save