Skip to content

Commit

Permalink
chore(docker): Proper use gradle based ORT_VERSION
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <heliocastro@gmail.com>
  • Loading branch information
heliocastro authored and tsteenbe committed Sep 29, 2023
1 parent 57054fd commit f705d56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-ort-runtime-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended:latest
labels: ${{ steps.meta.outputs.labels }}
build-contexts: |
ort=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest
ort=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:${{ env.ORT_VERSION }}
android=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/android:latest
swift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/swift:latest
scala=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/scala:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ort-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
push: true
load: false
build-args: |
NODEJS_VERSION=${{ env.NODEJS_VERSION }}
ORT_VERSION=${{ env.ORT_VERSION }}
tags: |
${{ steps.meta-ort.outputs.tags }}
${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest
Expand Down
13 changes: 7 additions & 6 deletions scripts/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
set -e -o pipefail

GIT_ROOT=$(git rev-parse --show-toplevel)
GIT_REVISION=$("$GIT_ROOT/gradlew" -q properties --property version | sed -nr "s/version: (.+)/\1/p")
ORT_VERSION=$("$GIT_ROOT/gradlew" -q properties --property version | sed -nr "s/version: (.+)/\1/p")
DOCKER_IMAGE_ROOT="${DOCKER_IMAGE_ROOT:-ghcr.io/oss-review-toolkit}"

echo "Setting ORT_VERSION to $GIT_REVISION."
echo "Setting ORT_VERSION to $ORT_VERSION."

# shellcheck disable=SC1091
. .versions
Expand Down Expand Up @@ -101,8 +101,8 @@ image_build golang ort/golang "$GO_VERSION" \
"$@"

# Runtime ORT image
image_build run ort "$GIT_REVISION" \
--build-arg NODEJS_VERSION="$NODEJS_VERSION" \
image_build run ort "$ORT_VERSION" \
--build-arg ORT_VERSION="$ORT_VERSION" \
--build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \
--build-context "python=docker-image://${DOCKER_IMAGE_ROOT}/ort/python:latest" \
--build-context "nodejs=docker-image://${DOCKER_IMAGE_ROOT}/ort/nodejs:latest" \
Expand Down Expand Up @@ -155,9 +155,10 @@ image_build haskell ort/haskell "$HASKELL_STACK_VERSION" \
# Runtime extended ORT image
docker buildx build \
--file Dockerfile-extended \
--tag "${DOCKER_IMAGE_ROOT}/ort-extended:$GIT_REVISION" \
--tag "${DOCKER_IMAGE_ROOT}/ort-extended:$ORT_VERSION" \
--tag "${DOCKER_IMAGE_ROOT}/ort-extended:latest" \
--build-context "ort=docker-image://${DOCKER_IMAGE_ROOT}/ort:latest" \
--build-arg ORT_VERSION="$ORT_VERSION" \
--build-context "ort=docker-image://${DOCKER_IMAGE_ROOT}/ort:${ORT_VERSION}" \
--build-context "sbt=docker-image://${DOCKER_IMAGE_ROOT}/ort/sbt:latest" \
--build-context "dotnet=docker-image://${DOCKER_IMAGE_ROOT}/ort/dotnet:latest" \
--build-context "swift=docker-image://${DOCKER_IMAGE_ROOT}/ort/swift:latest" \
Expand Down

0 comments on commit f705d56

Please sign in to comment.