Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .cloudbuild/jdbc_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ steps:
args: ['.kokoro/build.sh']
env:
- 'JOB_TYPE=jdbc-nightly-integration'
- name: 'gcr.io/cloud-devrel-public-resources/java11'
id: "Nightly build"
timeout: 10000s
entrypoint: 'bash'
args: ['.kokoro/jdbc-release.sh']

availableSecrets:
secretManager:
Expand Down
56 changes: 56 additions & 0 deletions .kokoro/jdbc-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${DIR}/../google-cloud-bigquery-jdbc"

FOLDER=release
DATE=$(date '+%Y-%m-%d')
COMMIT=$(git rev-parse --short HEAD)
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
BUCKET=gs://bq_devtools_release_private/drivers/jdbc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing customers already pull from this bucket and it's public. Just want to check if this being public is fine/ should we put this as an env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's internal bucket; I moved it to CloudBuild env

NIGHTLY_BUILD_DESTINATION="${BUCKET}/nightly/${VERSION}/${DATE}"

# All dependencies release
mkdir -p "./${FOLDER}"
make docker-package-all-dependencies PACKAGE_DESTINATION="$(pwd)/${FOLDER}"
JAR_FILE=$(find . -wholename "./${FOLDER}/*jar" -print -quit)
JAR_NAME=$(basename "${JAR_FILE}" .jar)-${DATE}-${COMMIT}

gsutil cp "${JAR_FILE}" "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}.jar"
rm -rf "${FOLDER}"

# All dependencies release - shaded
mkdir -p "./${FOLDER}"
make docker-package-all-dependencies-shaded PACKAGE_DESTINATION="$(pwd)/${FOLDER}"
JAR_FILE=$(find . -wholename "./${FOLDER}/*jar" -print -quit)

gsutil cp "${JAR_FILE}" "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}-shaded.jar"
rm -rf "${FOLDER}"

# Thin release
mkdir -p "./${FOLDER}"
make docker-package PACKAGE_DESTINATION="$(pwd)/${FOLDER}"
ZIP_FILE=$(find . -wholename "./${FOLDER}/*zip" -print -quit)

gsutil cp "${ZIP_FILE}" "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}.zip"
rm -rf "${FOLDER}"

# Update latest version
gsutil cp "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}.zip" "${BUCKET}/google-cloud-bigquery-jdbc-latest.zip"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq, how does this script do auth to determine if you have permission to upload?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloudBuild assigned service account has write permissions

gsutil cp "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}.jar" "${BUCKET}/google-cloud-bigquery-jdbc-latest-full.jar"
gsutil cp "${NIGHTLY_BUILD_DESTINATION}/${JAR_NAME}-shaded.jar" "${BUCKET}/google-cloud-bigquery-jdbc-latest-full-shaded.jar"
Loading