-
Notifications
You must be signed in to change notification settings - Fork 32
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
Added vite config and updated deploy to gh-pages script. #102
Changes from all commits
bb7378c
08f96d6
fbec90a
1ae72c4
39de04b
7bf756b
f45a102
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 |
---|---|---|
|
@@ -18,3 +18,5 @@ target/ | |
.classpath | ||
.project | ||
.settings/ | ||
|
||
/dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
auto-install-peers=false |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,26 +15,37 @@ | |||||
|
||||||
set -ue | ||||||
|
||||||
ORIGIN_BRANCH='master' | ||||||
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. these variables add confusion. I guess you are extracting them for tests. Please use these conventions if we must override for tests and add a comment that we are doing this.
|
||||||
TARGET_BRANCH='gh-pages' | ||||||
|
||||||
# Update gh-pages | ||||||
git fetch origin gh-pages:gh-pages | ||||||
git checkout gh-pages | ||||||
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. let me know how you tested this script as historically changes to scripts like this break and I need to fix them later when deployment failed. |
||||||
git fetch origin $TARGET_BRANCH:$TARGET_BRANCH | ||||||
git checkout $TARGET_BRANCH | ||||||
|
||||||
|
||||||
|
||||||
git checkout -qf $TARGET_BRANCH | ||||||
|
||||||
# Remove everything except .git | ||||||
rm -rf * | ||||||
|
||||||
git checkout $ORIGIN_BRANCH 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 less vocabulary in a script, the better. I was wondering what this "docs" directory was about. Consider the name of the repo is zipkin-api and there is no directory named docs anywhere. I was looking at this script later and wondering if something made a directory named docs via the build process. In our docker builds, we use the directory named "install" that works, workspace, etc.
Suggested change
|
||||||
|
||||||
git checkout -qf gh-pages | ||||||
cd docs | ||||||
pnpm i | ||||||
pnpm run build | ||||||
|
||||||
# TODO: these files can be in a list for convenience. | ||||||
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. maybe this is why you were adding this in the vite-config? This deserves a comment there to avoid me re-asking the same questions! something like?
|
||||||
git checkout master zipkin-api.yaml | ||||||
git add zipkin-api.yaml | ||||||
git checkout master zipkin2-api.yaml | ||||||
git add zipkin2-api.yaml | ||||||
git checkout master zipkin.proto | ||||||
git add zipkin.proto | ||||||
cp -r ./dist/* ../ | ||||||
cd .. | ||||||
rm -rf ./docs | ||||||
|
||||||
files_to_commit=$(git status -s) | ||||||
if [ ! -z "${files_to_commit}" ]; then | ||||||
git commit -m "Automatically updated IDL" | ||||||
echo "Pushing ${files_to_commit} to gh-pages" | ||||||
git push origin gh-pages | ||||||
git add --all | ||||||
git commit -m "Automatically updated dist" | ||||||
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.
Suggested change
|
||||||
echo "Pushing ${files_to_commit} to $TARGET_BRANCH" | ||||||
git push origin $TARGET_BRANCH | ||||||
fi | ||||||
|
||||||
# back to master | ||||||
git checkout master | ||||||
git checkout $ORIGIN_BRANCH |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!-- | ||
|
||
Copyright 2018-2024 The OpenZipkin Authors | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License | ||
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
or implied. See the License for the specific language governing permissions and limitations under | ||
the License. | ||
|
||
--> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Swagger UI</title> | ||
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" /> | ||
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16" /> | ||
<style> | ||
html | ||
{ | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after | ||
{ | ||
box-sizing: inherit; | ||
} | ||
|
||
body | ||
{ | ||
margin:0; | ||
background: #fafafa; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
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.
note renaming this file will break deploy. you can fix that by also changing build-bin/deploy with the name change.
In general, unless using an IDE like IntelliJ which detects this sort of thing for you, go back and do a recursive search any time you rename or delete some part of the build.