-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(docs-website): add vercel preview environment #7644
Changes from all commits
4806cea
156923b
cc62487
bc86a71
a9de060
fb1ece6
72e6abf
0b6777a
3539cca
9b96132
b0670c4
9ab1a88
c0b8968
16e1f93
55e52e3
721433e
d1fd642
153078e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
.vscode | ||
.vercel | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,3 @@ | ||
const fs = require("fs"); | ||
|
||
function list_ids_in_directory(directory, hardcoded_labels) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice |
||
if (hardcoded_labels === undefined) { | ||
hardcoded_labels = {}; | ||
} | ||
|
||
const files = fs.readdirSync(`../${directory}`).sort(); | ||
let ids = []; | ||
for (const name of files) { | ||
if (fs.lstatSync(`../${directory}/${name}`).isDirectory()) { | ||
// Recurse into the directory. | ||
const inner_ids = list_ids_in_directory(`${directory}/${name}`); | ||
ids = ids.concat(inner_ids); | ||
} else { | ||
if (name.endsWith(".md")) { | ||
const slug = name.replace(/\.md$/, ""); | ||
const id = `${directory}/${slug}`; | ||
|
||
if (id in hardcoded_labels) { | ||
label = hardcoded_labels[id]; | ||
ids.push({ type: "doc", id, label }); | ||
} else { | ||
ids.push({ type: "doc", id }); | ||
} | ||
} | ||
} | ||
} | ||
return ids; | ||
} | ||
|
||
// note: to handle errors where you don't want a markdown file in the sidebar, add it as a comment. | ||
// this will fix errors like `Error: File not accounted for in sidebar: ...` | ||
module.exports = { | ||
|
@@ -142,7 +111,12 @@ module.exports = { | |
], | ||
}, | ||
{ | ||
Sinks: list_ids_in_directory("metadata-ingestion/sink_docs"), | ||
Sinks: [ | ||
{ | ||
type: "autogenerated", | ||
dirName: "metadata-ingestion/sink_docs", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come these are in a different place from the source docs?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The source docs are generated by another build script, whereas these are raw md files |
||
}, | ||
], | ||
}, | ||
{ | ||
Transformers: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,23 @@ set -euxo pipefail | |
if [ "$(uname)" == "Darwin" ]; then | ||
brew install librdkafka | ||
else | ||
sudo apt-get update && sudo apt-get install -y \ | ||
librdkafka-dev \ | ||
python3-ldap \ | ||
libldap2-dev \ | ||
libsasl2-dev \ | ||
ldap-utils | ||
sudo_cmd="" | ||
if command -v sudo; then | ||
sudo_cmd="sudo" | ||
fi | ||
Comment on lines
+7
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we care, but this will print the result of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I didn't realize that In this case I don't think we care because it's just the path to |
||
|
||
if command -v yum; then | ||
$sudo_cmd yum install -y \ | ||
librdkafka-devel \ | ||
openldap-devel \ | ||
cyrus-sasl-devel \ | ||
openldap-clients | ||
else | ||
$sudo_cmd apt-get update && $sudo_cmd apt-get install -y \ | ||
librdkafka-dev \ | ||
python3-ldap \ | ||
libldap2-dev \ | ||
libsasl2-dev \ | ||
ldap-utils | ||
fi | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"buildCommand": "./gradlew :docs-website:build", | ||
"github": { | ||
"silent": true, | ||
"autoJobCancelation": true | ||
}, | ||
"installCommand": "amazon-linux-extras install python3.8 && py3=\"$(which python3)\" && rm \"$py3\" && ln \"$(which python3.8)\" \"$py3\" && ./metadata-ingestion/scripts/install_deps.sh && yum install -y gcc python38-devel", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come we're using python3.8 here? And what is running this command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this command is being run by vercel, which is a third-party tool |
||
"outputDirectory": "docs-website/build" | ||
} |
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 need both this and above?