-
Notifications
You must be signed in to change notification settings - Fork 36
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
DOP-5159 Specify content repo and parser version in build script for Netlify Frontend Builds #1309
Conversation
✅ Deploy Preview for docs-frontend-stg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for docs-frontend-dotcomprd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
❌ Deploy Preview for docs-frontend-dotcomstg failed. Why did it fail? →
|
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.
Looks good! Just one question
TESTING_ORGANIZATION=$1 # name of org, usually mongodb or 10gen | ||
TESTING_REPO_NAME=$2 # name of content repo | ||
TESTING_BRANCH_NAME=$3 # name of the branch | ||
PARSER_VERSION=$4 # version of the parser to download |
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.
Do we want to throw an error immediately if any of these are empty/undefined? Or do we want to have a fallback for the PARSER_VERSION and the TESTING_BRANCH_NAME? ie "latest" and "master"
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.
+1 for fallback defaults for these
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 can set the fallback for these values as environment variables in the UI, or throw an error if they're undefined in the toml. Which do you think is the better way to go @seungpark @mmeigs
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 feel like directly in the toml as fallbacks might be good to keep it clear !
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.
Sorry I'm not clear on what that would look like, would you mind elaborating? How is what you are suggesting different than what is currently in the toml?
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.
sorry, i meant directly in this shell script** but in the toml is fine. in the case we want to deploy multiple previews, is that possible?
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.
Hm, I believe Netlify only really supports one deploy preview per build, but I'll brainstorm more
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.
minor note on default values but overall looks good
TESTING_ORGANIZATION=$1 # name of org, usually mongodb or 10gen | ||
TESTING_REPO_NAME=$2 # name of content repo | ||
TESTING_BRANCH_NAME=$3 # name of the branch | ||
PARSER_VERSION=$4 # version of the parser to download |
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.
+1 for fallback defaults for these
command = ". ./build.sh $ORG_NAME $REPO_NAME $BRANCH_NAME $PARSER_VERSION" | ||
|
||
[build.environment] | ||
ORG_NAME = "mongodb" |
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.
are we only testing docs-landing for now, or can we build all content sites with this change right away. Out of curiosity, which ones have we already tested for ?
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.
All of them should be able to be built! I've tested landing, docs-cpp, and docs-relational-migrator so far
Stories/Links:
DOP-5159: Specify Content Repo and Parser version for Frontend Netlify builds
Current Behavior:
Currently, the frontend only builds the master branch of docs-landing unless the build script itself is changed.
Current netlify.toml
Current build script
docs-frontend-stg build
docs-frontend-dotcomstg build
Notes:
This PR updates the build script for Netlify builds, but will not have any effect on autobuilder builds. It allows for controlling the repo, repo branch, and parser version used for the Netlify build through environment variables, thus making it easier for DOP engineers to stage different repos in Netlify and laying the groundwork for fully functional Slack deploys.
I've updated the Netlify.toml, defining environment variables for each of the four variables the build script needs, ORG_NAME REPO_NAME, BRANCH_NAME, PARSER_VERSION, and then passing those as arguments to the build script. I then updated the build script accordingly to read in those four arguments and use them for cloning the specified content repo, checking out the specified branch, and downloading the specified parser version.
Note: If these environment variables are set in both the Netlify.toml and the Netlify UI, the values in the Toml will override the UI values.
README updates