This repository was archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Publishing the documentation
S. Ishida edited this page Jul 9, 2020
·
9 revisions
To update the Codewind website, push the content to the repo where Eclipse hosts the website.
- Be an Eclipse project committer.
- Add the ssh-rsa key so that you won't be blocked from pushing the site to make it live:
- A. Log in to
https://git.eclipse.org/r/#/q/status:open. - B. Click your user icon and click Settings.
- C. In Settings, click SSH Public Keys.
- D. Now, navigate to the Terminal on your computer. Enter
~/.ssh. - E. Enter
lsto view the contents of the file. You should seeid_rsa.pub. - F. Enter
cat id_rsa.pubto display the ssh-rsa key. - G. Copy the key, starting from
ssh-rsaat the beginning all the way to your email address at the end. - H. Back on the
https://git.eclipse.org/r/#/q/status:openwebsite, return to the SSH Public Keys section of "Settings." Paste the ssh-rsa key into the key box. Add the key.
- A. Log in to
Note: To preview the release branch, follow only steps 1 through 6. If you anticipate more changes to the release branch before the release, you should be able to delete the branch you created for your preview and then create a new branch after all changes for the release are merged.
- Open an issue for release preparation of the docs.
- In your Terminal, go to the
codewind-docsmasterbranch. Rungit fetch upstream. This command pulls in everything from your remote repository to your local repositories. - Then, run
git logand make sure that you see your latest changes.- To exit out of
git log, enter^q.
- To exit out of
- Create a branch for the release, such as 0.4.0.
- It's best to create a branch shortly before you are ready to publish.
- To create a new branch with the GitHub web UI, from the Branch combo box, start from
master, and then type in a new branch name. - Alternatively, from the command line, complete the following steps:
- Go to your
codewind-docsmasterbranch and entergit fetchand thengit pullto make sure you're up to date. - Enter
git checkout -b <release>. (Example:git checkout -b 0.4.0) - Then, enter
git push upstream <release>. (Example:git push upstream 0.4.0)
- Go to your
- Build the
codewind-docsrepo for local testing.- A. To ensure that you have the latest content from the
masterbranch, don't clone your fork. Instead, entergit fetch upstream. Then, create a new branch based onmasterwithgit checkout -b <branchname> upstream/<release branch>.- Example:
git checkout -b publish040 upstream/0.4.0
- Example:
- B. Enter
./build.shin thecodewind-docsrepo. It checks for internal broken links and displays an error if any exist.- If you find broken links, create a new PR to fix them. Merge the PR, and then try to run the
./build.shcommand again. - For more information about fixing broken links, see Checking for broken links.
- If you find broken links, create a new PR to fix them. Merge the PR, and then try to run the
- A. To ensure that you have the latest content from the
- Test.
- A. Run
./serve.sh. A URL, such ashttp://localhost:4321/codewind/, is displayed underServer address:. - B. Copy and paste the server address into your web browser. Look at the docs pages, and see if you can find problems like broken images.
- C. When you are done looking at the site, press
ctrl-cto stop the server. You need to stop it to restart it again.- In case the port is still in use, and you can't access the server, restart your computer.
- If you restart your computer and still cannot access the server, you can edit the
serve.shfile and change all 3 port numbers to any free port, such as4322.
-
Note: If you run the
./serve.shcommand and receiveERROR /favicon.ico' not found., disregard this error. It is a false positive and discussed in issue (2301)[https://github.com/eclipse/codewind/issues/2301#issuecomment-591004464]. As is, for the redirect to work on the published site, the publish will be required to be made withbuild.shoverserve.sh.
- A. Run
- Build the files that are ready for publishing.
- A. Run
./prepareForPublish.shto build the files into thecodewind-docs/docs/_sitedirectory.-
./serve.shis meant for local development and hard codes the host name and port number to deploy to. -
./serve.sh, therefore, builds the HTML redirects to point to local and not relative links. - Either
./build.shorprepareForPublish.shbuilds the redirects correctly, but./prepareForPublishisolates the stage withinbuild.shto create the site HTML so that the link checker is not run again.
-
- B. Confirm that redirects were created correctly by going to
codewind-docs/docs/_site/gettingstarted.html. View the file in an editor, and check the created redirect links.-
Correct redirect example:
<a href="/codewind/learn.html">Click here if you are not redirected.</a>. -
Incorrect redirect example:
<a href="http://0.0.0.0:4321/codewind/learn.html">Click here if you are not redirected.</a>.
-
Correct redirect example:
- A. Run
- Use
cd ../to get out of theCodewind-docsdirectory. - If you have not already done so, create a folder called
codewindwebin the GitHub parent folder on your computer. If you already have acodewindwebfolder, skip to step 3.-
Note: To prevent confusion with the GitHub
codewindrepo (https://github.com/eclipse/codewind) folder on your computer and the websitecodewindrepo (git://git.eclipse.org/gitroot/www.eclipse.org/codewind.git), create this new folder calledcodewindwebin a folder other than the one in which the GitHubcodewindrepo (https://github.com/eclipse/codewind) is located. - A. Use
cd codewindwebto go into thecodewindwebfolder. - B. To ensure that you have the latest content from the
masterbranch, don't clone your fork. Instead, entergit clone ssh://<your_username>@git.eclipse.org:29418/www.eclipse.org/codewind. - C. After cloning the live website repo, you are still in the
codewindwebfolder. Move into thecodewindweb/codewindfolder before running more Git commands.
-
Note: To prevent confusion with the GitHub
- If you already have a
codewindwebfolder, entercd codewindweb/codewindandgit pullto update with the latest files. - Use the
open .command to open Finder. - Enter
command+ato highlight all files incodewindweb/codewindand remove them. Delete all the files except for the hidden folders since those containgit config. - Replace the contents of the cloned
codewindfolder with the files from thecodewind-docs/docs/_sitedirectory.- A. Go to
codewind-docs/docs/_siteand entercommand+aandcommand+cto highlight all files and copy them. - B. Paste all copied items into the
codewindweb/codewindcloned folder.
- A. Go to
- Commit and push in.
- A. To view the files that you edited locally, enter
git status.- You might see fewer files than the total amount that the team edited over the course of the release. This is normal. Files that are new or have had their names changed appear as "Untracked files," but other files don't appear under this section.
- B. To add the file(s) to be committed, enter
git add -Afrom thecodewindweb/codewindfolder.- Now if you enter
git status, you should see the total list of all files edited over the course of the release.
- Now if you enter
- C. To commit the files, enter
git commit -s -m "<information about changes>". - D. To push, enter
git push.
- A. To view the files that you edited locally, enter
- Wait up to 30 minutes for the changes to go live.
- Note: There might be multiple servers that are distributed and not all updated at once, so you might not see the updated change even if others can, or you might see the updated page on your phone but not on your laptop. In this case, just keep waiting until the updates appear.
- Go to the website and check to make sure that the doc changes are present, that images aren't broken, and that the layout looks good, etc.
- Check that your commit is listed on this page: https://git.eclipse.org/c/www.eclipse.org/codewind.git/
Release branches are protected and cannot be deleted. Ideally, we should create a release branch only after all changes for the release are merged to the master branch. However, even if changes go into master after the creation of the release branch, we can still keep the release branch and the master branch in sync:
- From your command line, create a new branch based on the release branch with the
git checkout -b <name of branch> upstream/<release_branch>command. - From this new branch, enter
open .and delete all of thedocsdirectory content. - Now, create a temporary directory in a new location. The location should be at the same level or higher than the
codewind-docsdirectory. Create the directory with themkdir <name of directory>command. - Use the
cd <name of directory>command to enter the temporary directory. - From the temporary directory, enter
git clone git@github.com:eclipse/codewind-docs.gitto get themastercontent. - Copy the
mastercontent files over to the empty directory, the one that you created in step 1 with thegit checkoutcommand. - Enter
git status. All of the changes made tomastersince the release branch was created appear in red. - Enter
git add -Ato prepare to pull in all of the changes. When you rungit statusnow, the previously red files are all green. You should have no red files. - Create a pull request. In the GitHub web UI, make sure that the following values are set:
- base repository: eclipse/codewind-docs
- base: release branch
- head repository: <your_fork_name>/codewind-docs
- compare: <branch_where_your_changes_reside>
-
Note: You cannot download the compressed file of the
masterbranch content and then copy and paste it into the empty directory. If you try to copy and paste, GitHub counts all the pasted files as part of the change even though some have no change between the release branch andmaster.