Scaffold a new brand
This tutorial will guide you through scaffolding and preparing a brand for Nova development.
Create, configure, and populate the brand repo
The repo name should follow the pmc-${brand-name}-${launch-year} pattern.
For example, pmc-indiewire-2023 (opens in a new tab) or pmc-footwearnews-2023 (opens in a new tab).
Configure in Terraform
- Add the repo name output and repo configurations - Reference PR (opens in a new tab)
- Grant permissions and setup the theme pipeline - Reference PR (opens in a new tab)
- Configure the GitHub webhooks that Jenkins will use later to autodeploy - Reference PR (opens in a new tab)
- Add the Nova team to support code owners Reference PR (opens in a new tab)
- Expose Sonar tokens Reference PR (opens in a new tab)
Populating the theme with Nova's starter
Nova has its own theme, pmc-nova-theme (opens in a new tab), which is used for developing features and scaffolding new projects.
Until PMCP-5192 (opens in a new tab) is complete, this is a manual process.
Clone the contents of pmc-nova-theme (opens in a new tab) into your need theme and do the following,
- Find/replace:
@package pmc-nova-themenamespace Nova_Themeuse Nova_Theme@coversDefaultClass \Nova_Theme\pmc-nova-themein docker-compose.yml and composer.json (textdomain doesn't include year, but everything else does)
- Set
PMC\Nova\BRANDconstant - Update
config/nova/copyright.json - Update
style.css - Update
README.md - Update unit-test bootstrap namespace
- Update
sonar-project.propertiesafter configuring project in Sonar
Prepare for local development
Add to our VVV config
Follow along with the reference PR (opens in a new tab).
Create the brand in the Style Guide
Use the scaffold brand command,
npm run nova scaffold brand <brand-name>
npm run nova buildThis will create your brand in pmc-nova/style-guide/brands/${brand-name}.
Configure logos
You'll also need to configure some logos,
- Add a logo (svg) to
/style-guide/components/icon/icons/${brand-name}-logo.svgfor the style guide. - Add a logo (image) to
/style-guide/public/brands/${brand-name}.jpgfor the style guide.
Setup environments
Jenkins setup for PMCQA
This section needs more detail. Your milage may vary.
- Deploy feature branches to pmcqa.
- SSH in to create the new DB
- Go inside of docker and go from there, mysql cli to create everything
- Create a new database ex. vipgo_indiewire_2023
- Deploy
mainto root pmcqa site.
Jenkins setup for VIP Go
This section needs more detail. Your milage may vary.
- Webhook on the new repo that deploys to VIP Go (syncs the theme to the brand's wpcomvip repo's wp-content/themes/ folder).
- Add the site to Jenkins so sync to VIP staging happens.