Skip to content

Commit

Permalink
examples: add example with gsutil
Browse files Browse the repository at this point in the history
Hoping to reproduce #217. Still need to improve the situation with
examples vs integration tests (see #1168).
  • Loading branch information
fsouza committed May 27, 2023
1 parent 20e9922 commit 764dde0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
- lang: python
docker-image: python:latest
entrypoint: /bin/bash
- lang: gsutil
docker-image: python:latest
entrypoint: /bin/bash
- lang: node
docker-image: node:14-alpine
entrypoint: /bin/sh
Expand Down
12 changes: 12 additions & 0 deletions ci/run-gsutil-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2023 Francisco Souza. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -e

./fake-gcs-server -backend memory -port 4443 -data ${PWD}/examples/data &

pip install gsutil
./examples/gsutil/gsutil-example.sh

pkill fake-gcs-server
15 changes: 15 additions & 0 deletions examples/gsutil/gsutil-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# Copyright 2023 Francisco Souza. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -euo pipefail

bucket_name=some-bucket

gsutil -o "Credentials:gs_json_host=0.0.0.0" -o "Credentials:gs_json_port=4443" -o "Boto:https_validate_certificates=False" mb "gs://${bucket_name}"

gsutil -o "Credentials:gs_json_host=0.0.0.0" -o "Credentials:gs_json_port=4443" -o "Boto:https_validate_certificates=False" ls "gs://${bucket_name}"

gsutil -o "Credentials:gs_json_host=0.0.0.0" -o "Credentials:gs_json_port=4443" -o "Boto:https_validate_certificates=False" cp - "gs://${bucket_name}/hello.txt" <<<Hello

0 comments on commit 764dde0

Please sign in to comment.