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

Define Netlify CI variables in netlify.toml #1194

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Mar 3, 2025

What does this PR aim to accomplish?:

We just switched to Ubuntu Noble 24.04 which uses an up-to-date python (3.12) by default. See #1189 (comment)


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for pihole-docs ready!

Name Link
🔨 Latest commit 955b0cf
🔍 Latest deploy log https://app.netlify.com/sites/pihole-docs/deploys/67c8900b2a2b020008ea2d02
😎 Deploy Preview https://deploy-preview-1194--pihole-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yubiuser
Copy link
Member Author

yubiuser commented Mar 3, 2025

@PromoFaux

Are there any site environment variables set in Netlify's UI? Because it's still using Python 3.8

2025-03-03_22-45
2025-03-03_22-40

@PromoFaux
Copy link
Member

yeah, it was set to 3.8. Have changed it to 3.12 - try again!

@yubiuser
Copy link
Member Author

yubiuser commented Mar 3, 2025

Thanks. With the second commit I've set it via netlify.toml to 3.11 which matches the version we have on CI.

2025-03-03_22-58


I think I prefer to set it via config file instead of having it in the Netlify UI - It's easier to keep it up-to-date and not forget about it.
Renaming runtime.txt > netlify.toml still seems to be a good move because it's easier to understand what the file is for.

@yubiuser yubiuser changed the title Remove runtime.txt as we are using an up-to-date base image on Netlify Define python version for Netlify in netlify.toml instead of runtime.txt Mar 3, 2025
@yubiuser yubiuser requested a review from PromoFaux March 3, 2025 22:02
@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 4, 2025

If you are going with this, I suggest that you move all env vars and settings in runtime.txt and remove them from Netlify UI. That way everything will be handled in one place.

Other settings are Node version, build command, folder and maybe more.

@XhmikosR XhmikosR mentioned this pull request Mar 4, 2025
1 task
@yubiuser yubiuser changed the title Define python version for Netlify in netlify.toml instead of runtime.txt Define Netlify CI variables in netlify.toml Mar 4, 2025
@yubiuser
Copy link
Member Author

yubiuser commented Mar 4, 2025

I added all other environment variables defined in Netlify's UI to the netlify.toml

@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 4, 2025

How about build command and directory?

Also, will your settings work for branch deployments? I notice you used context.deploy-preview.environment only; I don't know if Netlify is using the same key for branch builds like production, too.

@XhmikosR XhmikosR mentioned this pull request Mar 4, 2025
1 task
@yubiuser yubiuser requested a review from a team March 5, 2025 18:02
@yubiuser
Copy link
Member Author

yubiuser commented Mar 5, 2025

Can squash down when desired

@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 5, 2025

See also https://docs.netlify.com/configure-builds/file-based-configuration/#build-settings

Both mkdocs build --strict or npm run build will work, I guess it makes more sense to use mkdocs build --strict on Netlify since Node.js isn't really needed.

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 this pull request may close these issues.

3 participants