Netlify build command cleanup
This PR contains suggested improvements to the site build scripts and config.
- Simplifies the
netlify.tomlbuild commands by using the NPM scripts. E.g., the production build command goes from:
to more the more concise yet equivalent:cd themes/docsy && git submodule update -f --init && npm install && cd ../.. && hugo --gc --minifynpm run build:production - Factors out common env var in
netlify.toml - Adds NPM scripts that simplify building and serving the site
/cc @nate-double-u
@chalin: GitHub didn't allow me to request PR reviews from the following users: nate-double-u.
Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs.
In response to this:
This PR contains suggested improvements to the site build scripts and config.
- Simplifies the
netlify.tomlbuild commands by using the NPM scripts. E.g., the production build command goes from:cd themes/docsy && git submodule update -f --init && npm install && cd ../.. && hugo --gc --minifyto more the more concise yet equivalent:
npm run build:production
- Factors out common env var in
netlify.toml- Adds NPM scripts that simplify building and serving the site
/cc @nate-double-u
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: chalin Once this PR has been reviewed and has the lgtm label, please assign zijianjoy for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Hi @chalin. Thanks for your PR.
I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Anything left to be done here? /cc @thesuperzapper
@chalin Also, all our PR/historical branches are getting indexed by Google, we should fix that at the same time as this PR.
The goals would be:
- The main
www.kubeflow.orgsite should be indexed - All PR
deploy-preview-XXXX--competent-brattain-de2d6d.netlify.appshould NOT be indexed - All other
v1-7-branch.kubeflow.orgsites should be NOT be indexed:- (these are just CNAME records pointing to the branch domains like
v1-7-branch--competent-brattain-de2d6d.netlify.app)
- (these are just CNAME records pointing to the branch domains like
I believe your changes here achieve 2, because you are setting -e dev in the hugo command, and because this is not "production", docsy adds <meta> no index tags.
We need to be careful about 1. Are you 100% confident that not setting -e production or HUGO_ENV=production is safe?
To achieve 3, we could set the HUGO_ENV from [context.branch-deploy.environment] to dev, but it will probably propagate faster if we use a robots.txt disallow on those domains (otherwise, the <meta> tags will take until Google next indexes each page).
I've created a separate issue to track the full extent of the indexing issue, since more work will need to be done outside of the scope of this PR:
- #3645
I believe your changes here achieve 2, because you are setting
-e devin the hugo command, and because this is not "production", docsy adds<meta>no index tags.
Correct.
We need to be careful about 1. Are you 100% confident that not setting
-e productionorHUGO_ENV=productionis safe?
For reassurance, see https://discourse.gohugo.io/t/what-does-setting-hugo-env-to-production-do/24669/2. Also, since the site uses hugo.IsProduction, we're good.
To achieve 3, we could set the
HUGO_ENVfrom[context.branch-deploy.environment]to dev, but it will probably propagate faster if we use arobots.txtdisallow on those domains (otherwise, the<meta>tags will take until Google next indexes each page).
I'll answer this in #3645.