提交 b4325224 编写于 作者: S Simon Kaegi 提交者: tekton-robot

Adds basic support for running locally without gcs creds

Checks-in "featured-background.jpeg" and cleans up sync.py and DEVELOPMENT.md
Add git ignores for node_modules and "generated" version-switcher.js
上级 a6a0d7b8
resources/
public/
package-lock.json
node_modules/
assets/js/version-switcher.js
# Developing the Tekton website
- [Setting up your dev environment](#setup)
- [Running locally](#running-locally)
- [tekton.dev](#tekton.dev)
- [Developing the Tekton website](#developing-the-tekton-website)
- [Running Locally](#running-locally)
- [tekton.dev](#tektondev)
## Running Locally
......@@ -36,13 +36,12 @@ To run the [Makefile](Makefile) you will need more dependencies and flags:
To run the makefile locally, you'll have to set the env var:
* `SKIP_BACKGROUND` (see [#38](https://github.com/tektoncd/website/issues/38)) to avoid having to supply GCP credentials
* [`DEPLOY_PRIME_URL`](https://docs.netlify.com/configure-builds/environment-variables/) to the path to your website files
For example:
```bash
SKIP_BACKGROUND=1 DEPLOY_PRIME_URL=localhost make preview-build
DEPLOY_PRIME_URL=localhost make preview-build
```
## tekton.dev
......
......@@ -20,18 +20,9 @@ TEMPLATE_DIR = './templates'
VAULT_DIR = './content/en/vault'
BUCKET_NAME = 'tekton-website-assets'
SKIP_BACKGROUND = os.environ.get('SKIP_BACKGROUND')
GCP_NETLIFY_ENV_CRED = os.environ.get('GCP_CREDENTIAL_JSON')
GCP_PROJECT = os.environ.get('GCP_PROJECT')
if not SKIP_BACKGROUND:
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()
gcs_bucket = gcs_client.get_bucket(BUCKET_NAME)
jinja_env = Environment(loader=FileSystemLoader(TEMPLATE_DIR))
......@@ -103,12 +94,6 @@ def prepare_vault_landing_page(component_versions):
f.write(md)
def download_background_image():
if not SKIP_BACKGROUND:
blob = gcs_bucket.blob('featured-background.jpeg')
blob.download_to_filename('./content/en/featured-background.jpeg')
def scan(dir_path):
entries = os.scandir(dir_path)
sync_config_paths = []
......@@ -132,4 +117,3 @@ if __name__ == '__main__':
component_versions = get_component_versions(sync_configs)
prepare_version_switcher_script(component_versions)
prepare_vault_landing_page(component_versions)
download_background_image()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册