Skip to content

Provisioning New Environments

Wade Barnes edited this page May 16, 2017 · 3 revisions

Intro

The typical product environment consists of four OpenShift projects;

  • tools
    • This OpenShift project is reserved for your Jenkins instance and any other build and deployment related tools you need to support the product.
  • dev
    • This OpenShift project is reserved for your Development application deployments.
  • test
    • This OpenShift project is reserved for your Test application deployments.
  • prod
    • This OpenShift project is reserved for your Production application deployments.

The openshift-tools repo contains a set of scripts, ./provisioning/environment/create-env.sh, to help automate the process of provisioning the standard set of projects.

Following is a description of how to use the script.

A note for windows users

Windows users can use the oc CLI tools for Windows in combination with GIT Bash to run the scripts.

  • Download and install the latest version of the OpenShift Origins CLI.
  • Add the install location to your Windows Path.
  • Clone the openshift-tools repo
  • Open a GIT Bash instance to the ./provisioning/environment folder.
  • Run the ./create-env.sh script. Prefixing the script name with ./ is required.

Before using the script

Before you use create-env.sh you will need to have project creation privileges on the OpenShift environment (https://console.pathfinder.gov.bc.ca:8443), and you will have had to login to the server using the oc CLI and the login string you can get from here; https://console.pathfinder.gov.bc.ca:8443/console/command-line.

Using create-env.sh

An example of how to create the standard set of projects:

./create-env.sh -e tools -e dev -e test -e prod

  • Where; -e is used to define one or more named environments. The standard ones being tools, dev, test, and prod.

The script will ask you a few important questions before it provisions the projects. Some of the answers will be used to generate a default name for the projects based on the following naming convention; <NameOfTeam/>-<ShortNameOfProduct/>-<EnvironmentName/>

  • Enter the name of the team:
    • Enter the name of your team. Keep it short. Use acronyms if needed. Don't use spaces.
    • This is used to generate a standardized name for the OpenShift project.
  • Enter the short name of the product:
    • Enter the short name of your product. Keep it short. Use acronyms if needed. Don't use spaces.
    • This is used to generate a standardized name for the OpenShift project.
  • Enter the display name of the product:
    • This will be the used in the OpenShift console as the display name for your project(s).
    • Try to keep it succinct. Whitespace and proper capitalization are a good idea here.
  • Enter the description of the product:
    • This will be the used in the OpenShift console as the description of your project(s).
    • Whitespace and proper capitalization are a good idea here.
  • Enter the category of the product:
    • There are typically three possible options; pathfinder, spark, and venture.
    • The choice is a business decision. Please consult with Todd Wilson.
  • Enter the path to the environment creation template (or enter to skip):
    • This is an advanced option. In most instances, you'll skip this step.
  • Enter the username name for the user who will be the admin for the new project (or enter to skip):
    • Enter the GitHub username for the user who will be acting as the admin for the project(s).
  • Enter the name for the project (or enter to use a 'teamfoo-productbar-tools'):
    • Before creating each OpenShift project you will be asked to confirm the name. This gives you the opportunity to override the default. If you have answered the questions properly the default should be acceptable.

Next steps

The script outputs an onboarding message, onboarding_message_out.txt, containing information about the project(s) that were generated. The content of this file should be emailed to the product administrator.

The script uses onboarding_message.txt as the template for the onboarding message. Any changes to the content should be made in the template.

At the time of writing (2017.05.16) the project names were not being written into the onboarding message correctly, requiring a manual update before sending the message.