bcgov / bcgov/quickstart-openshift

feat: create bootstrap script for automated GitHub & OpenShift setup

Open
#2,838 0 comments 0 reactions 1 assignee Claimed by @DerekRoberts View on GitHub
Dominant language
TypeScript
Stars
32
Forks
10
Avg merge
1h 26m
Merged PRs (30d)
23

Description

**Problem**
The current repository onboarding process requires developers to manually execute over 15 distinct steps—including navigating the GitHub UI to create environments/secrets, and running repetitive `oc` commands across three namespaces to provision tokens. This is tedious, error-prone, and a barrier to template adoption.

**Proposed Solution**
Provide a `scripts/bootstrap.sh` utility in the template. When a team clones the template, they run the script locally to fully scaffold their environments and secrets in seconds.

**Requirements**
1. **Prerequisite Checks**: Validate that `gh` (authenticated) and `oc` (authenticated) are installed.
2. **GitHub Scaffolding**: Automate the creation of `test` and `prod` environments using `gh api` (ensuring no "Required Reviewers" are applied, as deployments should be either Release-Gated or straight-to-prod).
3. **OpenShift Provisioning**: Loop through the `dev`, `test`, and `prod` namespaces to automatically create the `github-actions` ServiceAccount, bind the `edit` role, and generate long-lived tokens.
4. **Secret Injection**: Generate secure, distinct `db_password`s and push them—along with the `oc_namespace` and `oc_token`s—directly into the correct GitHub environments using `gh secret set`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.