Skip to content

Commit

Permalink
chore: upgrading emulators (#5900)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishwarajanand authored Mar 1, 2023
1 parent 56326d4 commit d7f4dc8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
15 changes: 13 additions & 2 deletions .github/emulator/start-emulator.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/bin/sh -eux

docker pull -q gcr.io/google.com/cloudsdktool/cloud-sdk:384.0.1-emulators
# default to "emulators", which is the latest available version
EMULATOR_VERSION=emulators
if [ "$#" -eq 2 ]; then
# use the supplied emulator version (e.g. "384.0.1-emulators")
EMULATOR_VERSION=$2
elif [ "$#" -ne 1 ]; then
echo "usage: start-emulator.sh PRODUCT_GROUP [EMULATOR_VERSION]"
exit 1;
fi
# Emulator version maybe different for individual products
IMAGE="gcr.io/google.com/cloudsdktool/cloud-sdk:$EMULATOR_VERSION"
docker pull -q $IMAGE
CONTAINER=`docker run \
-d \
-p 8085:8085 \
gcr.io/google.com/cloudsdktool/cloud-sdk:384.0.1-emulators gcloud beta emulators $1 start --host-port=0.0.0.0:8085 --project=emulator-project`
$IMAGE gcloud beta emulators $1 start --host-port=0.0.0.0:8085 --project=emulator-project`
sleep 10
docker logs $CONTAINER
4 changes: 3 additions & 1 deletion .github/workflows/bigtable-emulator-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
paths:
- 'Bigtable/**'
- '.github/workflows/bigtable-emulator-system-tests.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Bigtable/**'
- '.github/workflows/bigtable-emulator-system-tests.yaml'
- '.github/emulator/**'
name: Run Bigtable System Tests With Emulator
jobs:
test:
Expand All @@ -17,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: ./.github/emulator/start-emulator.sh bigtable
- run: ./.github/emulator/start-emulator.sh bigtable 419.0.0-emulators

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/datastore-emulator-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ on:
paths:
- 'Datastore/**'
- '.github/workflows/datastore-emulator-system-tests.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Datastore/**'
- '.github/workflows/datastore-emulator-system-tests.yaml'
- '.github/emulator/**'
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- run: ./.github/emulator/start-emulator.sh datastore
- run: ./.github/emulator/start-emulator.sh datastore 419.0.0-emulators

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/firestore-emulator-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
paths:
- 'Firestore/**'
- '.github/workflows/firestore-emulator-system-tests.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Firestore/**'
- '.github/workflows/firestore-emulator-system-tests.yaml'
- '.github/emulator/**'
name: Run Firestore System Tests With Emulator
jobs:
test:
Expand All @@ -17,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: ./.github/emulator/start-emulator.sh firestore
- run: ./.github/emulator/start-emulator.sh firestore 419.0.0-emulators

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pubsub-emulator-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
paths:
- 'PubSub/**'
- '.github/workflows/pubsub-emulator-system-tests.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'PubSub/**'
- '.github/workflows/pubsub-emulator-system-tests.yaml'
- '.github/emulator/**'
name: Run PubSub System Tests With Emulator
jobs:
test:
Expand All @@ -17,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: ./.github/emulator/start-emulator.sh pubsub
- run: ./.github/emulator/start-emulator.sh pubsub 412.0.0-emulators

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down

0 comments on commit d7f4dc8

Please sign in to comment.