Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of migrated code. Remaming. #2336

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions deploy/pipeline/mw-pipeline-v0.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ spec:
type: string
- name: INDY_PROXY_CLIENT_CREDENTIAL
type: string
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
- name: PNC_KONFLUX_TOOLING_IMAGE
type: string
default: "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/konflux-tooling:latest"
- name: NOTIFICATION_CONTEXT
type: string
default: ""
Expand Down Expand Up @@ -83,8 +84,8 @@ spec:
runAfter:
- git-clone
params:
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
value: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
- name: PNC_KONFLUX_TOOLING_IMAGE
value: $(params.PNC_KONFLUX_TOOLING_IMAGE)
- name: IMAGE_URL
value: $(params.QUAY_REPO):trusted-source-$(context.pipelineRun.name)
- name: NAME
Expand All @@ -108,7 +109,7 @@ spec:
resolver: http
params:
- name: url
value: https://raw.githubusercontent.com/rnc/jvm-build-service/refs/heads/BR3/deploy/tasks/pre-build.yaml
value: https://raw.githubusercontent.com/rnc/jvm-build-service/refs/heads/BR1/deploy/tasks/pre-build.yaml
workspaces:
- name: source
workspace: source
Expand Down Expand Up @@ -157,8 +158,8 @@ spec:
runAfter:
- buildah-oci-ta
params:
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
value: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
- name: PNC_KONFLUX_TOOLING_IMAGE
value: $(params.PNC_KONFLUX_TOOLING_IMAGE)
- name: IMAGE_URL
value: $(tasks.buildah-oci-ta.results.IMAGE_URL)
- name: IMAGE_DIGEST
Expand All @@ -179,8 +180,8 @@ spec:
params:
- name: ACCESS_TOKEN
value: $(params.ACCESS_TOKEN)
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
value: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
- name: PNC_KONFLUX_TOOLING_IMAGE
value: $(params.PNC_KONFLUX_TOOLING_IMAGE)
- name: NOTIFICATION_CONTEXT
value: $(params.NOTIFICATION_CONTEXT)
- name: STATUS
Expand All @@ -191,8 +192,8 @@ spec:
description: Access token for OAuth.
type: string
default: ""
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
description: Name of the processor image. Useful to override for development.
- name: PNC_KONFLUX_TOOLING_IMAGE
description: Name of the tooling image.
type: string
- name: NOTIFICATION_CONTEXT
description: Notification context
Expand All @@ -202,7 +203,7 @@ spec:
type: string
steps:
- name: notification
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
image: $(params.PNC_KONFLUX_TOOLING_IMAGE)
args:
- notify
- --context=$(params.NOTIFICATION_CONTEXT)
Expand Down
7 changes: 3 additions & 4 deletions deploy/tasks/maven-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ spec:
description: Access token for OAuth.
type: string
default: ""
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
description: Name of the processor image. Useful to override for development.
- name: PNC_KONFLUX_TOOLING_IMAGE
description: Name of the tooling image.
type: string
default: "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/jvm-build-service/build-request-processor:latest"
- name: caTrustConfigMapKey
description: The name of the key in the ConfigMap that contains the
CA bundle data.
Expand Down Expand Up @@ -82,7 +81,7 @@ spec:
- name: IMAGE_URL
value: $(params.IMAGE_URL)
- name: deploy
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
image: $(params.PNC_KONFLUX_TOOLING_IMAGE)
securityContext:
runAsUser: 0
computeResources:
Expand Down
94 changes: 94 additions & 0 deletions deploy/tasks/pre-build-git.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: pre-build-git
annotations:
tekton.dev/pipelines.minVersion: 0.12.1
tekton.dev/tags: image-build, konflux
labels:
app.kubernetes.io/version: "0.1"
build.appstudio.redhat.com/build_type: docker
spec:
description: |-
Sets up pre-build for pushing the source.
params:
- name: PRE_BUILD_IMAGE_DIGEST
description: Digest to use
type: string
- name: NAME
description: Name of the pipeline run (i.e. unique dependency build name)
type: string
- name: GIT_IDENTITY
description: Git username. If empty, deploy-pre-build-source step will be skipped.
type: string
default: ""
- name: GIT_URL
description: String to determine whether we're using gitlab or github
type: string
default: "github"
- name: GIT_SSL_VERIFICATION
description: Whether to disable ssl verification
type: string
default: "false"
- name: GIT_REUSE_REPOSITORY
description: Whether to reuse existing git repository or create new one
type: string
default: "false"
- name: SCM_URL
description: Reference to the git repository
type: string
- name: SCM_HASH
description: Git hash
type: string
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
description: Name of the processor image. Useful to override for development.
type: string
results:
- name: GIT_ARCHIVE
description: Git archive information
volumes:
- name: workdir
emptyDir: {}
stepTemplate:
volumeMounts:
- mountPath: /var/workdir
name: workdir
steps:
- name: restore-trusted-artifact
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:52f1391e6f1c472fd10bb838f64fae2ed3320c636f536014978a5ddbdfc6b3af
script: |
echo "Restoring source to workspace"
use-archive $PRE_BUILD_IMAGE_DIGEST=/var/workdir/
env:
- name: PRE_BUILD_IMAGE_DIGEST
value: $(params.PRE_BUILD_IMAGE_DIGEST)
- name: create-pre-build-source
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
securityContext:
runAsUser: 0
computeResources:
limits:
cpu: 300m
memory: 512Mi
requests:
cpu: 10m
memory: 512Mi
env:
- name: GIT_DEPLOY_TOKEN
valueFrom:
secretKeyRef:
optional: true
name: jvm-build-git-repo-secrets
key: gitdeploytoken
args:
- deploy-pre-build-source
- --source-path=/var/workdir
- --task-run-name=$(context.taskRun.name)
- --scm-uri=$(params.SCM_URL)
- --scm-commit=$(params.SCM_HASH)
- --image-id=$(params.NAME)
- --git-identity=$(params.GIT_IDENTITY)
- --git-url=$(params.GIT_URL)
- --git-disable-ssl-verification=$(params.GIT_SSL_VERIFICATION)
- --git-reuse-repository=$(params.GIT_REUSE_REPOSITORY)
97 changes: 19 additions & 78 deletions deploy/tasks/pre-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,34 @@ metadata:
build.appstudio.redhat.com/build_type: docker
spec:
description: |-
Sets up pre-build running the preprocessor, pushing the source and creating the OCI image.
Sets up pre-build running the preprocessor creating the OCI image.
params:
- name: IMAGE_URL
description: URL of the OCI image to use.
type: string
- name: NAME
description: Name of the pipeline run (i.e. unique dependency build name)
type: string
- name: GIT_IDENTITY
description: Git username. If empty, deploy-pre-build-source step will be skipped.
type: string
default: ""
- name: GIT_URL
description: String to determine whether we're using gitlab or github
type: string
default: "github"
- name: GIT_SSL_VERIFICATION
description: Whether to disable ssl verification
type: string
default: "false"
- name: GIT_REUSE_REPOSITORY
description: Whether to reuse existing git repository or create new one
type: string
default: "false"
- name: SCM_URL
description: Reference to the git repository
type: string
- name: SCM_HASH
description: Git hash
type: string
- name: RECIPE_IMAGE
description: The image from the build recipe to use
- name: BUILD_TOOL
description: The build tool to use (ant, gradle, maven, sbt).
- name: BUILD_TOOL_VERSION
description: The build tool version to use (e.g. 3.9.5)
- name: JAVA_VERSION
description: Java version to use (7, 8, 9, 11, 17, 21, 22, 23)
- name: BUILD_PLUGINS
description: Optional comma separated list of build plugins that should be disabled.
default: ""
- name: BUILD_SCRIPT
description: The build script to embed with the Containerfile
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
description: Name of the processor image. Useful to override for development.
- name: JAVA_VERSION
description: Java version to use (7, 8, 9, 11, 17, 21, 22, 23)
- name: IMAGE_URL
description: URL of the OCI image to use.
type: string
- name: PNC_KONFLUX_TOOLING_IMAGE
description: Name of the tooling image.
type: string
default: "quay.io/ncross/hacbs-jvm-build-request-processor:latest"
# default: "quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/jvm-build-service/build-request-processor:latest"
- name: RECIPE_IMAGE
description: The image from the build recipe to use
results:
- name: PRE_BUILD_IMAGE_DIGEST
description: Digest of the image just built
- name: GIT_ARCHIVE
description: Git archive information
workspaces:
- description: The git repo will be cloned onto the volume backing this Workspace.
name: source
mountPath: /var/workdir
steps:
- name: preprocessor
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
image: $(params.PNC_KONFLUX_TOOLING_IMAGE)
securityContext:
runAsUser: 0
computeResources:
Expand All @@ -80,47 +48,20 @@ spec:
requests:
cpu: 10m
memory: 512Mi
script: |
/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
args:
- prepare
- --build-tool-version=$(params.BUILD_TOOL_VERSION)
- --java-version=$(params.JAVA_VERSION)
- --recipe-image=$(params.RECIPE_IMAGE)
- --tooling-image=$(params.PNC_KONFLUX_TOOLING_IMAGE)
- --type=$(params.BUILD_TOOL)
- $(workspaces.source.path)/source
env:
- name: BUILD_SCRIPT
value: $(params.BUILD_SCRIPT)
# TODO: Look at making this optional until we know whether we need to store source
- name: create-pre-build-source
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
securityContext:
runAsUser: 0
computeResources:
limits:
cpu: 300m
memory: 512Mi
requests:
cpu: 10m
memory: 512Mi
env:
- name: GIT_DEPLOY_TOKEN
valueFrom:
secretKeyRef:
optional: true
name: jvm-build-git-repo-secrets
key: gitdeploytoken
args:
- deploy-pre-build-source
- --source-path=$(workspaces.source.path)/source
- --task-run-name=$(context.taskRun.name)
- --scm-uri=$(params.SCM_URL)
- --scm-commit=$(params.SCM_HASH)
- --image-id=$(params.NAME)
- --git-identity=$(params.GIT_IDENTITY)
- --git-url=$(params.GIT_URL)
- --git-disable-ssl-verification=$(params.GIT_SSL_VERIFICATION)
- --git-reuse-repository=$(params.GIT_REUSE_REPOSITORY)
- name: create-pre-build-image
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:52f1391e6f1c472fd10bb838f64fae2ed3320c636f536014978a5ddbdfc6b3af
script: |
set -x
echo "IMAGE is $(params.IMAGE_URL)"
cat $HOME/.docker/config.json || true
echo "Creating pre-build-image archive"
create-archive --store $(params.IMAGE_URL) $(results.PRE_BUILD_IMAGE_DIGEST.path)=$(workspaces.source.path)/source
env:
Expand Down
14 changes: 4 additions & 10 deletions java-components/build-request-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@
<artifactId>pom-manipulation-common</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand All @@ -136,9 +129,10 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import com.redhat.hacbs.container.build.preprocessor.maven.MavenPrepareCommand;
import com.redhat.hacbs.container.build.preprocessor.sbt.SBTPrepareCommand;
import com.redhat.hacbs.container.deploy.BuildVerifyCommand;
import com.redhat.hacbs.container.deploy.CopyArtifactsCommand;
import com.redhat.hacbs.container.deploy.DeployCommand;
import com.redhat.hacbs.container.deploy.DeployPreBuildSourceCommand;
import com.redhat.hacbs.container.notification.NotifyCommand;
import com.redhat.hacbs.container.verifier.VerifyBuiltArtifactsCommand;

import io.quarkus.picocli.runtime.annotations.TopCommand;
Expand All @@ -21,14 +19,12 @@
@CommandLine.Command(mixinStandardHelpOptions = true, subcommands = {
AnalyseDependencies.class,
AntPrepareCommand.class,
CopyArtifactsCommand.class,
BuildVerifyCommand.class,
GradlePrepareCommand.class,
DeployPreBuildSourceCommand.class,
LookupBuildInfoCommand.class,
LookupScmLocationCommand.class,
DeployCommand.class,
NotifyCommand.class,
MavenPrepareCommand.class,
SBTPrepareCommand.class,
VerifyBuiltArtifactsCommand.class
Expand Down
Loading
Loading