Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Latest commit

 

History

History
124 lines (80 loc) · 3.59 KB

README.md

File metadata and controls

124 lines (80 loc) · 3.59 KB

developers.redhat.com Preview Environments

This directory contains a few utility scripts to help you connect to the preview environment associated with your pull request build.

Getting started

Install the Openshift CLI

Before you can use these scripts you will need to install the Openshift Command Line tools (OC). The current version of OC that is supported is 3.11.

The OC binary can be downloaded from the following locations:

Download the binary and install it somewhere into your $PATH. Once installed you should be able to run:

which oc

The Managed Platform clusters enforce GSSAPI/Kerberos authentication on all environments, so once you have the binary installed ensure that oc version from the command line shows you something like this:

Robs-Mac-mini:previews Rob$ oc version
oc v3.11.0+02103b0-103-dirty
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://manage.us-west.dc.preprod.paas.redhat.com:443
openshift v3.11.88
kubernetes v1.11.0+d4cacc0

The bit you're looking for is features: Basic-Auth GSSAPI Kerberos SPNEGO. If that all looks good, you're set to continue.

Configure Kerberos Authentication

Next you need to follow ITs instructions on how to configure Kerberos authentication. The instructions are here and include details for Mac users.

Once you've followed their instructions, you should be able to do the following:

kinit <username>@IPA.REDHAT.COM
oc login manage.us-west.dc.preprod.paas.redhat.com -u <username>
Create local configuration

Finally copy the oc-config.sh.example to oc-config.sh. This configures the helper scripts with details specific to your account. You should under no circumstances check this file into Git and it is configured already in the .gitignore of this directory.

Connecting to Drupal in your preview environment

You can connect to the Drupal container for your pull request by running the following:

./connect-to-drupal.sh <pull_request_id>

So for pull request 39, that would be:

./connect-to-drupal.sh 39

This will drop you into a bash shell on the Drupal container. Once there you should additionally run:

source /etc/scl_enable

You can now browse around the container as you see fit to investigate any issues with your preview environment.

Connecting to the database in your preview environment

To connect to the database in your preview environment use the following:

./connnect-to-db.sh <pull_request_id>

So for pull request 39 that would be:

./connect-to-db.sh 39

Viewing the boot logs for Drupal in your preview environment

For whatever reason it may be that Drupal is not booting after your latest changes. You can view the Drupal boot sequence to diagnose any problems with the following:

./view-drupal-boot-logs.sh <pull_request_id>

So for pull request 39 that would be:

./view-drupal-boot-logs.sh 39

Watching the Drupal logs

You can also watch requests as they come into Drupal to help diagnose any issues. Use the following for that:

./view-drupal-logs.sh <pull_request_id>

So for pull request 39 that would be:

./view-drupal-logs.sh 39