Skip to content

build: fix docs-content branch publish #12690

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions scripts/deploy/publish-docs-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,24 @@ echo "Starting deployment of the docs-content for ${buildVersionName} in ${branc
# Remove the docs-content repository if the directory exists
rm -Rf ${docsContentPath}

# Clone the docs-content repository.
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1
echo "Starting cloning process of ${docsContentRepoUrl} into ${docsContentPath}.."

echo "Successfully cloned docs-content repository."
if [[ $(git ls-remote --heads ${docsContentRepoUrl} ${branchName}) ]]; then
echo "Branch ${branchName} already exists. Cloning that branch."
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1 --branch ${branchName}

# Go into the repository directory.
cd ${docsContentPath}
cd ${docsContentPath}
echo "Cloned repository and switched into the repository directory (${docsContentPath})."
else
echo "Branch ${branchName} does not exist yet."
echo "Cloning default branch and creating branch '${branchName}' on top of it."

echo "Switched into the repository directory."
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1
cd ${docsContentPath}

echo "Cloned repository and switched into directory. Creating new branch now.."

if [[ $(git ls-remote --heads origin ${branchName}) ]]; then
git checkout ${branchName}
echo "Switched to ${branchName} branch."
else
echo "Branch ${branchName} does not exist on the docs-content repo yet. Creating ${branchName}.."
git checkout -b ${branchName}
echo "Branch created and checked out."
fi

# Remove everything inside of the docs-content repository.
Expand Down Expand Up @@ -123,6 +124,6 @@ echo "Credentials for docs-content repository are now set up. Publishing.."
git add -A
git commit --allow-empty -m "${buildCommitMessage}"
git tag "${buildTagName}"
git push origin master --tags
git push origin ${branchName} --tags

echo "Published docs-content for ${buildVersionName} into ${branchName} successfully"