Skip to content

Commit

Permalink
dataconnect: internal convenience script updates (#6509)
Browse files Browse the repository at this point in the history
  • Loading branch information
dconeybe authored Nov 13, 2024
1 parent d6bfc7b commit 848650b
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 30 deletions.
6 changes: 1 addition & 5 deletions firebase-dataconnect/scripts/compile_kotlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -43,6 +38,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down
38 changes: 38 additions & 0 deletions firebase-dataconnect/scripts/emulator_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Copyright 2024 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

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

(
set -xv
cd "${PROJECT_ROOT_DIR}"/firebase-dataconnect/emulator
./wipe_postgres_db.sh
./start_postgres_pod.sh
)

readonly args=(
"${PROJECT_ROOT_DIR}/gradlew"
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
":firebase-dataconnect:connectors:runDebugDataConnectEmulator"
)

echo "${args[*]}"
exec "${args[@]}"
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -32,6 +27,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down
6 changes: 1 addition & 5 deletions firebase-dataconnect/scripts/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -39,6 +34,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down
6 changes: 1 addition & 5 deletions firebase-dataconnect/scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -35,6 +30,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down
6 changes: 1 addition & 5 deletions firebase-dataconnect/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -35,6 +30,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down
6 changes: 1 addition & 5 deletions firebase-dataconnect/scripts/spotlessApply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

set -euo pipefail

if [[ $# -gt 0 ]] ; then
echo "ERROR: no command-line arguments are supported, but got $*" >&2
exit 2
fi

readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.."

readonly TARGETS=(
Expand All @@ -35,6 +30,7 @@ readonly args=(
"-p"
"${PROJECT_ROOT_DIR}"
"--configure-on-demand"
"$@"
"${TARGETS[@]}"
)

Expand Down

0 comments on commit 848650b

Please sign in to comment.