LogoLogo
  • Planet 4
  • Development
    • Contribute
    • Installation
    • Git Guidelines
    • Coding Standards
    • Continuous Delivery
  • CI/CD
    • Test Instances
    • Deployment
    • Testing
      • End-to-end Tests
      • Visual Regression Tests
  • NRO Customization
    • Development
      • Using Child Themes
      • Package Registry
      • Plugins
    • Testing
      • Visual Regression Tests
    • Deployment
      • Production
      • DB/Media Sync
  • Infrastructure
    • NRO Generation
    • ElasticSearch
    • Cloudflare
  • Recipes
    • Maintenance page
    • Production sync
    • Running commands
  • Platform
    • Practices
    • ADRs
      • [ADR-0001] Use Gitbook for Technical Documentation
      • [ADR-0002] P3 Archive elastic search integration
      • [ADR-0003] WYSIWYG Blocks Architecture
      • [ADR-0004] Switch to Monorepo
      • [ADR-0006] Define scope for deployment environments
      • [ADR-0008] PSR-4 Autoloading Standard
      • [ADR-0009] Include Media Library in master theme
      • [ADR-0011] PHP Coding Standards
      • [ADR-0012] Use custom SCSS syntax for variables
      • [ADR-0013] Choose a ticketing system
      • [ADR-0014] Choose a testing framework
      • [ADR-0015] Use block templates to build block patterns
      • [ADR-0016] Form Builder data retention policy
      • [ADR-0017] Move blocks into the theme
    • Changelog
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
  • Tech
    • Wordpress
    • Blocks
    • Plugins
    • Hooks
    • Data migrations
    • CSS variables
Powered by GitBook
On this page
  • Requirements
  • Local dependencies
  • Permissions and repositories
  • Build the configuration
  • Create the environments
Edit on GitHub
  1. Infrastructure

NRO Generation

How to create a new P4 NRO instance

PreviousDB/Media SyncNextElasticSearch

Last updated 1 year ago

Requirements

Local dependencies

Permissions and repositories

  • Google Cloud Project access in the development (planet-4-151612) and production (planet4-production) projects.

  • Git repositories checked out (main branch)

Build the configuration

Get inside the planet-nro-generator repository and follow the instructions on . In a nutsell:

./configure.sh
make run

If you want to create only a Development environment just type false for release and production.

There are two manual steps in this process. Adding a github ssh key to CircleCI and create a new set of Google OAuth tokens. You should get quick links to both of them on the terminal output.

Create the environments

First connect to the development cluster

# get connected to google cloud development cluster:
gcloud container clusters get-credentials p4-development --zone us-central1-a --project planet-4-151612

# Start using the development cluster
kubectl config set-context p4-develop --namespace=develop --cluster=gke_planet-4-151612_us-central1-a_p4-development --user=gke_planet-4-151612_us-central1-a_p4-development

# switch to our own context
kubectl config use-context p4-develop
  1. The configure command will ask you about the helm chart to use.

  2. It will also ask you to provide the OAuth tokens you created in the previous step.

  3. The make command will ask a few times about replacing defaultcontent path with your own. Choose y.

./configure.sh
make

If you are also creating staging and production environments you can repeat these steps, after you switch to the production cluster. Here is an example for cidev release instance:

# get connected to the google cloud for the production cluster
gcloud container clusters get-credentials planet4-production --zone us-central1-a --project planet4-production

# or if i wanted a specific site context for the release. (replace the "cidev" bellow with your site):
kubectl config set-context planet4-cidev-release --namespace cidev --cluster gke_planet4-production_us-central1-a_planet4-production --user gke_planet4-production_us-central1-a_planet4-production

# switch to that context (replace the "cidev" bellow with your site):
kubectl config use-context planet4-cidev-release

Once this is done, you can just re-run ./configure.sh and make. In order for the staging and production helm charts to be listed in the configure command, one successful deploy should be completed in the CI. Make sure to tag the new deploy repository to trigger that.

Get inside the planet-helper-scripts repository and follow the instructions on . In a nutshell:

Docker
gcloud
kubectl
helm
planet4-nro-generator
planett4-helper-scripts
README.md
README.md