Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Poetry - Publishing inside a google cloud build #27

Closed
BigJerBD opened this issue Jan 22, 2022 · 1 comment
Closed

Support for Poetry - Publishing inside a google cloud build #27

BigJerBD opened this issue Jan 22, 2022 · 1 comment

Comments

@BigJerBD
Copy link

This question is related to #17
However I have decided to make another issue since its on a different topic

I have followed the directives of this comment with success , but now i'm try to do it via a google cloud build but I keep getting 403 errors

basically this works locally but not with google cloud build :

poetry version "$(poetry version -s)+$COMMIT_SHA"

poetry plugin add keyrings.google-artifactregistry-auth
poetry config repositories.google $REGISTRY_URL

poetry publish -r google --build

Here's the raised error on GCB

      227│     ) -> None:
      226│         self, session: requests.Session, url: str, dry_run: Optional[bool] = False
      225│     def _do_upload(
      224│ 
    → 223│             raise UploadError(e)
      222│ 
      221│                     raise UploadError(e)
      220│                 except HTTPError as e:
      219│                     self._register(session, url)
  at /opt/poetry/venv/lib/python3.8/site-packages/poetry/publishing/uploader.py:223 in _upload

  HTTP Error 403: Forbidden

  UploadError


The following error occurred when trying to handle this error:

      964│         called the underlying ``raw`` object must not be accessed again.
      963│         """Releases the connection back to the pool. Once this method has been
      962│     def close(self):
      961│ 
    → 960│             raise HTTPError(http_error_msg, response=self)
      959│         if http_error_msg:
      958│ 
      957│             http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
      956│         elif 500 <= self.status_code < 600:
  at /opt/poetry/venv/lib/python3.8/site-packages/requests/models.py:960 in raise_for_status

Please note that locally I log in with gcloud first but, not within our google cloud build trigger.
I Also made sure that the cloudbuild service account was an Artifact Registry Writer for the used registry

Any insight about this would be greatly appreciated. Thanks :)

@BigJerBD
Copy link
Author

Im closing this issue. this seems to work properly now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant