-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toph docs pipeline fixes bugs n gitbook (#12114)
* WIP * WIP2 * WIP3 * Remove comment/better comments * Remote deployment updates * Adds GH user for yarn deploy * WIP 6 * WIP7 * WIP8 * WIP 10 * Working easy from home not so much in the cloud
- Loading branch information
1 parent
079e8b0
commit f065d36
Showing
3 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,23 +31,20 @@ pwd | |
|
||
|
||
# Yarn check (which is commonly used to check for program existance) | ||
# -s/--silent doesn't exist in cloud's Ubuntu | ||
if ! which yarn > /dev/null; then | ||
echo -e "$red_text""yarn not found HALP!!\n\n""$default_text" | ||
exit 1 | ||
fi | ||
|
||
set -o xtrace | ||
|
||
# touch is non-destructive and the cloud doesn't have this file | ||
touch $HOME/.gitconfig | ||
|
||
# Set email and user name | ||
if ! git config --list --global | grep --silent user.email; then | ||
# local check for changes. Fail here early instead of 40 seconds from now | ||
if ! test -z "$(git status --short)"; then | ||
set +o xtrace | ||
echo -e "$blue_text""github email not found adding Octavia's""$default_text" | ||
set -o xtrace | ||
git config --global user.email="[email protected]" | ||
git config --global user.name="octavia-squidington-iii" | ||
echo -e "$red_text""You have uncommitted changes!!!\n\n""$default_text" | ||
echo -e "$red_text""Commit and try again""$default_text" | ||
exit 1 | ||
fi | ||
|
||
cd docusaurus | ||
|
@@ -59,9 +56,23 @@ yarn install | |
# generate static content | ||
yarn build | ||
|
||
# context https://v1.docusaurus.io/docs/en/publishing#using-github-pages | ||
# write a prod website to airbytehq/airbyte gh_pages branch | ||
GIT_USER=octavia-squidington-iii yarn run deploy | ||
# Check tty for local/remote deploys (we expect cloud to be non-interactive) | ||
# results like /dev/ttys000 || not a tty | ||
if test "$(tty)" == "not a tty"; then | ||
set +o xtrace | ||
echo -e "$blue_text""github email not found adding Octavia's""$default_text" | ||
set -o xtrace | ||
git config user.email="[email protected]" | ||
git config user.name="octavia-squidington-iii" | ||
echo "machine github.com login octavia-squidington-iii password $GITHUB_TOKEN" > $HOME/.netrc | ||
# context https://v1.docusaurus.io/docs/en/publishing#using-github-pages | ||
# write a prod website to airbytehq/airbyte gh_pages branch | ||
# NOT ACTUALLY WORKING | ||
GIT_USER="octavia-squidington-iii" yarn run publish-gh-pages | ||
else | ||
yarn run deploy | ||
fi | ||
|
||
|
||
|
||
|
||
|
@@ -71,8 +82,11 @@ pwd | |
|
||
# We should be here but we are playing with fire | ||
git fetch | ||
# We force push gh-pages. Local copies confuse things | ||
# This line uses || true to enure we don't error if that branch doesn't exist | ||
git branch -D gh-pages 2> /dev/null || true | ||
# checkout the branch tracking it's remote | ||
git switch gh-pages | ||
git switch --track origin/gh-pages | ||
|
||
# For tracking in the commit message | ||
revision=$(git rev-parse --short HEAD) | ||
|
@@ -94,11 +108,18 @@ git commit --message "Adds CNAME to deploy for $revision" | |
# non functional. for debugging | ||
git branch | ||
|
||
# note that this is NOT airbyte repo | ||
git push --force https://$GITHUB_TOKEN@github.com/airbytehq/airbytehq.github.io.git | ||
if test "$(tty)" == "not a tty"; then | ||
# note that this is NOT airbyte repo | ||
git push --force https://octavia-squidington-iii:$GITHUB_TOKEN@github.com/airbytehq/airbytehq.github.io.git | ||
else | ||
git push --force [email protected]:airbytehq/airbytehq.github.io.git | ||
fi | ||
|
||
# Let's leave the tire fire of force pushes | ||
git checkout - | ||
|
||
|
||
# Want to push from your own computer? uncomment this line and comment out the push above | ||
# git push --force https://[email protected]/airbytehq/airbytehq.github.io.git | ||
|
||
set +o xtrace | ||
echo -e "$blue_text""Script exiting 0 GREAT SUCCESS!!!?""$default_text" |