Skip to content
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
40 changes: 40 additions & 0 deletions docker/owlbot/nodejs_mono_repo/build-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/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
#
# https://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.

# File for local development of the Docker image. This is not intended to be used in CI, but can be used to test changes to the Dockerfile and entrypoint script.
set -e

# Get the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Navigate to the root of the synthtool repo
cd "$DIR/../../.."

echo "Preparing post-processor-changes.txt..."
# Generate post-processor-changes.txt as expected by some Dockerfiles/CI
git log -1 --format="%B%n%nSource-Link: https://github.com/googleapis/synthtool/commit/%H" > post-processor-changes.txt &&
sed -i "s/([^()]*)$//g" post-processor-changes.txt &&
sed -i "s/^\(feat\|fix\)/chore/g" post-processor-changes.txt &&
sed -i "s/\!:/:/g" post-processor-changes.txt

echo "Building owlbot-nodejs-mono-repo..."
docker build -t owlbot-nodejs-mono-repo -f docker/owlbot/nodejs_mono_repo/Dockerfile .

# Cleanup temporary file
rm post-processor-changes.txt

echo ""
echo "Successfully built owlbot-nodejs-mono-repo"
echo "To run it against a local repository, use:"
echo " docker run --rm -v \$(pwd):/workspace -w /workspace owlbot-nodejs-mono-repo [RELATIVE_DIRS]"
5 changes: 2 additions & 3 deletions synthtool/languages/node_mono_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from synthtool.languages import common
from datetime import date
import logging
from os import system
from synthtool import _tracked_paths
from synthtool import gcp

Expand Down Expand Up @@ -641,7 +640,7 @@ def owlbot_entrypoint(
for dir in specified_owlbot_dirs:
owlbot_py_file_path = hasOwlBotPy(dir)
if owlbot_py_file_path:
system(f"python3 {owlbot_py_file_path}")
subprocess.run(["python3", str(owlbot_py_file_path)], check=True)
else:
owlbot_main(
dir,
Expand All @@ -657,7 +656,7 @@ def owlbot_entrypoint(
for dir in owlbot_dirs:
owlbot_py_file_path = hasOwlBotPy(dir)
if owlbot_py_file_path:
system(f"python3 {owlbot_py_file_path}")
subprocess.run(["python3", str(owlbot_py_file_path)], check=True)
else:
owlbot_main(
dir,
Expand Down