vmware-tanzu / tanzu-dev-portal

Content for Tanzu dev portal
Apache License 2.0
138 stars 166 forks source link

VMwareNetlify Status

About The Project

Tanzu Developer Center Screen Shot

The Tanzu Developer Center is a site specifically built to be a great resource for software development teams. The contributions on the Tanzu Developer Center are from teams across VMware, as well as individuals without.

Our guiding principle is to ensure readers have free, immediate access to all the content on the Tanzu Developer Center. No purchase is ever necessary to access content on the Tanzu Developer Center because it is either open source or an easily accessible trial.

Getting Started Building a Local Deployment of the Tanzu Developer Center

Clone this repository

    git clone --recurse-submodules https://github.com/vmware-tanzu/tanzu-dev-portal.git

These options help speed up the repo setup by initializing submodules during the clone process.

There are two available options for building and running a local preview of the Tanzu Developer Center:

  1. Using the dev container
  2. Setup a local build environment

Option 1: Using The Dev Container

The Dev Container is offered to simplify a local environment setup for those working with and contributing to the Tanzu Developer Center.

This method requires the following software be installed:

An alternative option if make is unavailable is to utilize docker cli commands to setup the dev-container and work with make from there.

Building the Dev Container Image and Container

(Note: The docker daemon must be running):

make dev-container

This will connect to a bash shell in the container immediately after it has finished the build process.

The default working directory in the shell will be the Tanzu Developer Center git repo directory (it is mounted as a volume in the container). All file edits/additions made from within the container are persistent and saved on the host system.

The container is configured to replicate a fully functional local developer setup. From within the Dev Container shell prompt, run make help to see a list of available actions.

Interacting With Dev Container

The Makefile includes several actions to interact with the dev container. All of the commands are in the following format:

make dev-container.<action>

Use make help to see the full list of actions

Some examples:

make dev-container.pr-test # Simulates all github pull request checks using the container in docker and act
make dev-container.shell # Starts the container and connects to a bash shell

From the container shell, a preview of the site can be built using:

make preview

Option 2: Setup A Local Build Environment

These are the software prerequisites needed to build a local preview of the Tanzu Developer Center site.

Software Installation Prerequisites

Note: These instructions were designed for Mac users. Linux and Windows users without access to make and brew will need to manually install the prerequisites.

_Note: The reason the .nvmrc is required even though the default should already be v16 for default image that Netlify is set to use - Ubuntu Focal 20.04 - when the site repository was originally linked Netlify, it was using an older image that defaulted to v12, so it must be specified explicitly in the .nvmrc file. (See this article for more details._

With all the dependencies installed, use make help to see the available actions.

Troubleshooting

Q. I'm receiving an error about cloning themes/docsy

With the change with how the theme files are overridden, the first time you update your branch you may see the following issue when running make preview:

git submodule update --init --recursive
Submodule 'themes/docsy' (https://github.com/google/docsy.git) registered for path 'themes/docsy'
fatal: not a git repository: /private/tmp/tanzu-dev-portal/themes/docsy/../../.git/modules/themes/docsy
Failed to clone 'themes/docsy'. Retry scheduled
BUG: submodule considered for cloning, doesn't need cloning any more?
fatal: could not get a repository handle for submodule 'themes/docsy'
make: *** [theme] Error 1

You can run the following command for a one-time fix:

make clean-submodule

Q. make preview is throwing a fatal error: pipe failed error

This is due to the number of files that are opened during the process of building the site. If you're on OSX, this can be addressed with the following command:

sudo launchctl limit maxfiles 65535 200000
ulimit -n 65535
sudo sysctl -w kern.maxfiles=100000
sudo sysctl -w kern.maxfilesperproc=65535

Q. I am on Windows and make preview doesn't work

On Windows, you may need to use hugo server -D to start the application. The site will then be available on http://localhost:1313/

Open Projects, Issues, and Content Backlog

See the open issues and project boards for a list of proposed features, content backlog, and known issues.

Contributing

Content contributions are what make open source and the developer community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Contributing Code

The code contribution process is documented in CONTRIBUTING.md.

Contributing Content

The content contribution process is documented fully on our GitHub wiki site and includes methods for both VMware employees as well as non-employees to contribute to content or bug fixes.

Code of Conduct

We, the Admin team of the Tanzu Developer Center adhere to a code of conduct available here: CODE_OF_CONDUCT.md.

Tanzu Developer Center Open Source License

The Tanzu Developer Center is distributed under the Apache License. For more information, see LICENSE.