Skip to content

Commit 61baa4c

Browse files
authored
Merge pull request #2172 from rnc/SCRIPTS
Generate build script within preprocessor
2 parents 085d45b + e22538f commit 61baa4c

File tree

25 files changed

+487
-440
lines changed

25 files changed

+487
-440
lines changed

README.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ The following environment variables are configurable and may be set by the user
3838
| JBS_QUAY_IMAGE_TAG | The tag for the images (defaults to `dev`)
3939
| JBS_QUAY_ORG | JBS images are pulled by default from the `QUAY_USERNAME` organization. This may be overridden by changing this
4040
| JBS_BUILD_IMAGE_SECRET | Secret for accessing Quay.io (See below)
41-
| JBS_DISABLE_CACHE | Internal variable for disabling the cache
4241
| JBS_GIT_CREDENTIALS | Support for private repositories (See below)
4342
| JBS_MAX_MEMORY | Maximum additional memory allowed
4443
| JBS_RECIPE_DATABASE | Recipe database to use (defaults to `https://github.com/redhat-appstudio/jvm-build-data`)

deploy/tasks/pre-build.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ spec:
4444
- name: RECIPE_IMAGE
4545
description: The image from the build recipe to use
4646
- name: BUILD_TOOL
47-
description: The build tool to use.
47+
description: The build tool to use (ant, gradle, maven, sbt).
48+
- name: BUILD_TOOL_VERSION
49+
description: The build tool version to use (e.g. 3.9.5)
50+
- name: JAVA_VERSION
51+
description: Java version to use (7, 8, 9, 11, 17, 21, 22, 23)
4852
- name: BUILD_PLUGINS
49-
description: Comma separated list of build plugins that should be disabled.
53+
description: Optional comma separated list of build plugins that should be disabled.
5054
default: ""
5155
- name: BUILD_SCRIPT
5256
description: The build script to embed with the Containerfile
@@ -77,8 +81,10 @@ spec:
7781
cpu: 10m
7882
memory: 512Mi
7983
script: |
80-
$(params.BUILD_SCRIPT)
81-
/opt/jboss/container/java/run/run-java.sh $(params.BUILD_TOOL)-prepare $(workspaces.source.path)/source --recipe-image=$(params.RECIPE_IMAGE) --request-processor-image=$(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE) --disabled-plugins=$(params.BUILD_PLUGINS)
84+
/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
85+
env:
86+
- name: BUILD_SCRIPT
87+
value: $(params.BUILD_SCRIPT)
8288
# TODO: Look at making this optional until we know whether we need to store source
8389
- name: create-pre-build-source
8490
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
@@ -111,6 +117,8 @@ spec:
111117
- --git-reuse-repository=$(params.GIT_REUSE_REPOSITORY)
112118
- name: create-pre-build-image
113119
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:bc10298bff7805d8bc98211cd4534b9720f365f35ce0ef263dd65802de7ff036
120+
# The build-trusted-artifacts container doesn't handle REGISTRY_TOKEN but the actual .docker/config.json.
121+
# Setting ORAS_OPTIONS to ensure the archive is compatible with jib (for OCIRepositoryClient) (to be removed)
114122
script: |
115123
echo "Creating pre-build-image archive with ORAS_OPTIONS $ORAS_OPTIONS"
116124
export ORAS_OPTIONS="$ORAS_OPTIONS --image-spec=v1.0 --artifact-type application/vnd.oci.image.config.v1+json"

0 commit comments

Comments
 (0)