repository_creation

package
v0.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 12 Imported by: 0

README

Repo Generation Tool

WARNING

Interim actions required after completion of generating a repository

  • Change branch name main to master
  • Update security settings for the master branch to match that of main

For exact instructions on how to complete this please read the following guide MAIN_TO_MASTER. These steps should be removed once CI has been updated to use main as the leading branch.

Usage prerequisite
GitHub 'Personal Access Token'
  1. Navigate to github.com
  2. Click your Avatar
  3. Go to Settings
  4. Go to Developer Settings
  5. Click Personal Access Token
  6. Generate an Access token with permissions to manipulate repositories
Be a member of the ONS Dissemination team and the ONSDigital organisation with permissions to create new repositories

How to use
  1. (optional) Export the environment variable GITHUB_PERSONAL_ACCESS_TOKEN with your github personal access token
  2. Run dp create-repo github
  3. Enter your 'Personal Access Token' when prompted (if step 1. was not complete)
  4. Enter your GitHub handle when prompted
  5. Enter your repository name, note that if the repository is specific to the Dissemination Platform then prefix it with dis-
  6. Enter a description for the repository when prompted

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepository

func CloneRepository(ctx context.Context, cloneUrl, projectLocation, appName string) error

CloneRepository will clone a given repository at a given location, the location is the projectLocation joined with appName

func GenerateGithub

func GenerateGithub(name, description string, ProjectType project_generation.ProjectType, personalAccessToken, branchStrategy string, teamSlugsInput string) (cloneUrl string, err error)

GenerateGithub is the entry point to generating the repository

func PromptForInput

func PromptForInput(prompt string) string

PromptForInput gives a user a message and expect input to be provided

func PushToRepo

func PushToRepo(ctx context.Context, projectLocation, appName string) error

PushToRepo will push the contents of a given local directory to a set project remote (.git)

func RunGenerateRepo

func RunGenerateRepo(cmd *cobra.Command, args []string) error

Types

type GitHubTeam added in v0.52.0

type GitHubTeam struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL