diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index facd632dee1..5760b8757a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/ci/run-gsutil-example.sh b/ci/run-gsutil-example.sh new file mode 100644 index 00000000000..ded1e13ed97 --- /dev/null +++ b/ci/run-gsutil-example.sh @@ -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 diff --git a/examples/gsutil/gsutil-example.sh b/examples/gsutil/gsutil-example.sh new file mode 100755 index 00000000000..6b6cea00b2b --- /dev/null +++ b/examples/gsutil/gsutil-example.sh @@ -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" <<