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

Netlify build command cleanup #3628

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
public/
/public

# Modules generated by node.js for CSS editing
node_modules/
package-lock.json

# Resources directory generated by Hugo local build
resources/
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
16 changes: 3 additions & 13 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
[build]
publish = "public"
command = "cd themes/docsy && git submodule update -f --init && npm install && cd ../.. && hugo --gc --minify"
command = "npm run build:preview"

[context.deploy-preview.environment]
HUGO_VERSION = "0.119.0"
NODE_VERSION = "18"

[context.production.environment]
HUGO_VERSION = "0.119.0"
HUGO_ENV = "production"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting HUGO_ENV is no longer required.

NODE_VERSION = "18"

[context.branch-deploy.environment]
HUGO_VERSION = "0.119.0"
NODE_VERSION = "18"
Comment on lines -14 to -16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chalin Won't removing this prevent the old branches like https://github.com/kubeflow/kubeflow/tree/v1.7-branch, from being deployed, because we achieve this by using a CNAME record from:

  • v1-7-branch.kubeflow.org -> v1-7-branch--competent-brattain-de2d6d.netlify.app

I don't have access to the Netelify dashboard, so I can't see where those are being deployed from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thesuperzapper - from my understanding of how Netlify works, unless you back port this change to an older v1.x branch, the builds of other branches won't be affected.

For example, v1.7 has it's own netlify.toml file, https://github.com/kubeflow/website/blob/v1.7-branch/netlify.toml, with it's own env var values and commands:

website/netlify.toml

Lines 1 to 16 in b48a664

[build]
publish = "public"
command = "cd themes/docsy && git submodule update -f --init && cd ../.. && hugo --gc --minify"
[context.deploy-preview.environment]
HUGO_VERSION = "0.92.0"
NODE_VERSION = "16"
[context.production.environment]
HUGO_VERSION = "0.92.0"
HUGO_ENV = "production"
NODE_VERSION = "16"
[context.branch-deploy.environment]
HUGO_VERSION = "0.92.0"
NODE_VERSION = "16"

But, I could be wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't have access to kubeflow.org's Netlify dashboard.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@james-jwu or @zijianjoy do you have access to Netelify for the Kubeflow website, so we can confirm how it is configured?

We probably also need to give access in some way to the CNCF for continuity purposes.

[context.production]
command = "npm run build:production"
Comment on lines +5 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that using context.production will still work?

I don't have access to the Netelify dashboard, so I can check, but based on Hugo's docs: https://gohugo.io/hosting-and-deployment/hosting-on-netlify/ they seem to suggest that context.production.environment is the right heading.

@james-jwu or @zijianjoy probably have access to Netelify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using similar setups for the OTel and gRPC websites, e.g., see https://github.com/open-telemetry/opentelemetry.io/blob/5df8d080fe6997d1ee514b9f50f6880155276e5b/netlify.toml#L1-L6:

[build]
publish = "public"
command = "npm run seq -- build:preview diff:check"

[context.production]
command = "npm run seq -- build:production diff:check"

The .environment section is for setting environment variables only, not for setting other fields like command.

Loading