-
Notifications
You must be signed in to change notification settings - Fork 10
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
Download the list of members from Google Spreadsheet, download avatars as files #85
Conversation
df199cb
to
6636d00
Compare
I can check the rest within a week. Let me know if that's to late for you |
I want to have the site ready for 100th Prague Pyvo and before the summer sprint. Going to bike over the weekend, so I think ~week should be okay. I'm working on another, parallel, but significantly smaller PR which I'll issue promptly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a little bit more verbose?
$ pipenv run build
Loading .env environment variables…
### Members | ||
|
||
Pyvec members are tracked in an internal Google Spreadsheet. The future | ||
intention is to have the list of members public, but we're not there yet (GDPR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intention is to have the list of members public, but we're not there yet (GDPR). | |
intention is to have the list of members public, but we're not there yet. |
pyvecorg/build.py
Outdated
|
||
|
||
def generate_yaml(data): | ||
yaml_contents = '''\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using textwrap.dedent
instead. Or not, it's just a tip.
Note: according to bylaws the list of members should contain a date of birth, which I wouldn't like to leak for anyone, it's over my limits of what can be secured by security by obscurity and what cannot. This needs to be reworked into something using Google API to access a private Google document. |
b29f45c
to
6c9c2d7
Compare
@hroncok I reworked it so the list uses Google API. Result: |
I don't get it. I think Travis has a problem:
I'm very tempted to migrate this repo to Circle CI. |
3a98e7e
to
daa14d1
Compare
daa14d1
to
2815334
Compare
|
||
1. Follow the steps in the [gspread guide](https://gspread.readthedocs.io/en/latest/oauth2.html). Instead of Google Drive API, enable Google Sheets API. | ||
1. Save the obtained JSON file into the `pyvecorg` package as `google_service_account.json` | ||
1. Make sure it is ignored by Git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the setup up until this point is needed for local hacking as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But since it is decoupled, you should be able to run the site without members being populated, for editing other parts of the page.
@hroncok Addressed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🇮🇹
See https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables for a reference and https://circleci.com/gh/pyvec/pyvec.org/15#build-parameters/containers/0 (Spin Up Environment) for examples: BASH_ENV=/tmp/.bash_env-5d614082be728d64db773f33-0-build CI=true CIRCLECI=true CIRCLE_BRANCH=honzajavorek/members CIRCLE_BUILD_NUM=15 CIRCLE_BUILD_URL=https://circleci.com/gh/pyvec/pyvec.org/15 CIRCLE_COMPARE_URL= CIRCLE_JOB=build CIRCLE_NODE_INDEX=0 CIRCLE_NODE_TOTAL=1 CIRCLE_PREVIOUS_BUILD_NUM=14 CIRCLE_PROJECT_REPONAME=pyvec.org CIRCLE_PROJECT_USERNAME=pyvec CIRCLE_PULL_REQUEST=pyvec/pyvec.org#85 CIRCLE_PULL_REQUESTS=pyvec/pyvec.org#85 CIRCLE_REPOSITORY_URL=git@github.com:pyvec/pyvec.org.git CIRCLE_SHA1=f6e04550035d3f904014689ee8f1541346b5feaf CIRCLE_SHELL_ENV=/tmp/.bash_env-5d614082be728d64db773f33-0-build CIRCLE_STAGE=build CIRCLE_USERNAME=honzajavorek CIRCLE_WORKFLOW_ID=e8affa4d-f267-4930-b339-af510fc8f849 CIRCLE_WORKFLOW_JOB_ID=ce6ad044-09a4-4d4e-8423-ce085a50be0b CIRCLE_WORKFLOW_UPSTREAM_JOB_IDS= CIRCLE_WORKFLOW_WORKSPACE_ID=e8affa4d-f267-4930-b339-af510fc8f849 CIRCLE_WORKING_DIRECTORY=~/repo CI_PULL_REQUEST=pyvec/pyvec.org#85 CI_PULL_REQUESTS=pyvec/pyvec.org#85
This change introduces a new separate step needed for development and deployment of the site -
pipenv run build
, which downloads data from external sources. Even though the site is serialized into a static HTML so one might think doing it in Flask views is not a problem, I think this is a better solution, because I can runpipenv run build
just once and then develop the site with fast refreshing or even offline.In this PR I introduce downloading of members list from a spreadsheet saved in Pyvec Google Drive. It updates the board members according to the latest changes. When I was at it, I also moved all avatar handling into the build step - no more proxy views to make thumbnails etc. Now all avatars are downloaded to a directory inside
static
as PNG images during the build step.