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

fix(deployment): Pass SDKMAN_JAVA_VERSION when building deployment image (#29685) #29757

Merged
Merged
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
19 changes: 18 additions & 1 deletion .github/workflows/cicd_comp_deployment-phase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ jobs:
with:
fetch-depth: 0

- name: Get SDKMan Version
id: get-sdkman-version
shell: bash
run: |
if [ -f .sdkmanrc ]; then
SDKMAN_JAVA_VERSION=$(awk -F "=" '/^java=/ {print $2}' .sdkmanrc)
echo "using default Java version from .sdkmanrc: ${SDKMAN_JAVA_VERSION}"
echo "SDKMAN_JAVA_VERSION=${SDKMAN_JAVA_VERSION}" >> $GITHUB_OUTPUT
else
echo "No .sdkmanrc file found"
exit 1
fi

# Clean up the runner to ensure a fresh environment
- uses: ./.github/actions/core-cicd/cleanup-runner

Expand All @@ -88,6 +101,9 @@ jobs:
docker_io_username: ${{ secrets.DOCKER_USERNAME }}
docker_io_token: ${{ secrets.DOCKER_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
build_args: |
DOTCMS_DOCKER_TAG=${{ inputs.environment }}
SDKMAN_JAVA_VERSION=${{ steps.get-sdkman-version.outputs.SDKMAN_JAVA_VERSION }}

# Build and push the dev Docker image (if required)
- name: Build/Push Docker Dev Image
Expand All @@ -107,7 +123,8 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_args: |
DOTCMS_DOCKER_TAG=${{ inputs.environment }}
DEV_REQUEST_TOKEN=${{ secrets.DEV_REQUEST_TOKEN }}
DEV_REQUEST_TOKEN=${{ secrets.DEV_REQUEST_TOKEN }}
SDKMAN_JAVA_VERSION=${{ steps.get-sdkman-version.outputs.SDKMAN_JAVA_VERSION }}

# Deploy CLI artifacts to JFrog Artifactory
- name: CLI Deploy
Expand Down
4 changes: 3 additions & 1 deletion dotCMS/src/main/docker/original/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ----------------------------------------------
# Stage 1: Construct our container using the minimal-java image and copying the prebuilt dotcms
# ----------------------------------------------
ARG SDKMAN_JAVA_VERSION="11.0.22-ms"
# Need to specify the SDKMAN_JAVA_VERSION to a valid sdkman java version that is available in the dotcms/java-base image
ARG SDKMAN_JAVA_VERSION="SDKMAN_JAVA_VERSION_ARG_NOT_SET"

FROM dotcms/java-base:${SDKMAN_JAVA_VERSION} AS container-base
WORKDIR /srv

Expand Down
Loading