Documentation ¶
Overview ¶
Copyright 2020 Adobe. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Repo
- func (r *Repo) Clean() error
- func (r *Repo) Commit(message, gitopsPath string) bool
- func (r *Repo) GetLastCommitMessage() (msg string)
- func (r *Repo) IsClean() bool
- func (r *Repo) Push(branches []string)
- func (r *Repo) RecreateBranch(branch, primaryBranch string)
- func (r *Repo) SwitchToBranch(branch, primaryBranch string) (new bool)
- type Server
- type ServerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct { // Dir is the location of the git repo. Dir string }
Repo is a clone of a git repository. Create with Clone, and don't forget to clean it up after.
func Clone ¶
Clone clones a repository. Pass the full repository name, such as "https://aleksey.pesternikov@bitbucket.tubemogul.info/scm/tm/repo.git" as the repo. Cloned directory will be clean of local changes with primaryBranch branch checked out. repo: https://aleksey.pesternikov@bitbucket.tubemogul.info/scm/tm/repo.git dir: /tmp/cloudrepo mirrorDir: optional (if not empty) local mirror of the repository
func (*Repo) Commit ¶
Commit all changes to the current branch. returns true if there were any changes
func (*Repo) GetLastCommitMessage ¶
GetLastCommitMessage fetches the commit message from the most recent change of the branch
func (*Repo) Push ¶
Push pushes all local changes to the remote repository all changes should be already commited
func (*Repo) RecreateBranch ¶
RecreateBranch discards a branch content and reset it from primaryBranch.
func (*Repo) SwitchToBranch ¶
SwitchToBranch switch the repo to specified branch and checkout primaryBranch files over it. if branch does not exist it will be created
type ServerFunc ¶
func (ServerFunc) CreatePR ¶
func (f ServerFunc) CreatePR(from, to, title, body string) error