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

Avoid downloading image from GCS when generating website #38

Closed
bobcatfish opened this issue Mar 18, 2020 · 0 comments · Fixed by #43
Closed

Avoid downloading image from GCS when generating website #38

bobcatfish opened this issue Mar 18, 2020 · 0 comments · Fixed by #43

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

It should be possible to build and preview the website without requiring access to a GCS bucket for the background image.

Actual Behavior

The makefile commands used to build and run the website run sync.py which requires GCP credentials:

website/sync/sync.py

Lines 26 to 31 in 43e149b

if GCP_NETLIFY_ENV_CRED:
credentials = service_account.Credentials.from_service_account_info(json.loads(GCP_NETLIFY_ENV_CRED))
gcs_client = storage.Client(project=GCP_PROJECT,
credentials=credentials)
else:
gcs_client = storage.Client()

It seems like the reason is to grab the background image:

website/sync/sync.py

Lines 105 to 107 in 43e149b

def download_background_image():
blob = gcs_bucket.blob('featured-background.jpeg')
blob.download_to_filename('./content/en/featured-background.jpeg')

Additional Info

Maybe we can commit the background image to the repo instead? I have a feeling I'm missing something here

bobcatfish added a commit to bobcatfish/website that referenced this issue Mar 18, 2020
The DEVELOPMENT.md was very out of date! Also uncovered some difficult
to work with things along the way such as tektoncd#38
bobcatfish added a commit to bobcatfish/website that referenced this issue Mar 18, 2020
The DEVELOPMENT.md was very out of date! Also uncovered some difficult
to work with things along the way such as tektoncd#38
which made it so that you need credentials to access the GCP bucket with
the background image in order to be able to run the sync script. I've
added a very hacky env var which lets one skip this until we tackle tektoncd#38
tekton-robot pushed a commit that referenced this issue Mar 19, 2020
The DEVELOPMENT.md was very out of date! Also uncovered some difficult
to work with things along the way such as #38
which made it so that you need credentials to access the GCP bucket with
the background image in order to be able to run the sync script. I've
added a very hacky env var which lets one skip this until we tackle #38
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

Successfully merging a pull request may close this issue.

1 participant