1

I have a drone cicd pipeline that builds a npm project which I want to upload to Google Cloud Storage (gcs). I found a drone gcs plugin which seems to be able to do so. But I don't know what to use for the token parameter. The documentation says: "credentials to access Google Cloud Storage".

I have create a ServiceAccount and downloaded the json for it. My first attempt was to use the base64 encode json (as done with the App Engine Plugin) but this failed with this error:

failed to authenticate token: invalid character 'e' looking for beginning of value1

Is this a oauth2 token? How can I create a token, so that drone-ci can upload the files to my bucket?

Andre Albert
  • 1,386
  • 8
  • 17
  • Have you tried to generate an access token from the [OAuth 2.0 Playground](https://developers.google.com/oauthplayground/)? – Catherine O Jun 07 '22 at 01:13
  • Thank you for the hint. I created an auth2 accesscode token but getting a similar error message: `failed to authenticate token: invalid character 'y' looking for beginning of value` - maybe I have to just use a container with a plain `gsutil` to copy files to gcs – Andre Albert Jun 07 '22 at 10:51

1 Answers1

2

I see the GCS plugin is broken :(, but I have added another plugin Google Cloud Auth that allows you to pass SA json as string secret and then use the auth plugin to activate the SA based auth.

You can then mount the ~/.config/gcloud in all the required steps and do the required gcloud tasks. For an example check https://plugins.drone.io/plugins/google-cloud-run that uses this method.

I hope this helps you.

Kamesh
  • 115
  • 11