Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins:
- - "@google/semantic-release-replace-plugin"
- replacements:
- files: [ "setup.py "]
from: "version=\"UNRELEASED\""
from: "version=\"0.0.0\""
to: "version=\"${nextRelease.version}\""
countMatches: true
results:
Expand Down
22 changes: 15 additions & 7 deletions docs/commands/create-pr-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ gitopscli create-pr-preview \

## Usage
```
usage: gitopscli create-pr-preview [-h] --username USERNAME --password PASSWORD
[--git-user GIT_USER] [--git-email GIT_EMAIL]
--organisation ORGANISATION --repository-name
REPOSITORY_NAME [--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
--pr-id PR_ID
[--parent-id PARENT_ID] [-v [VERBOSE]]
usage: gitopscli create-pr-preview [-h] --username USERNAME --password
PASSWORD [--git-user GIT_USER]
[--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION
--repository-name REPOSITORY_NAME
[--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
--pr-id PR_ID [--parent-id PARENT_ID]
[-v [VERBOSE]]

options:
-h, --help show this help message and exit
Expand All @@ -39,6 +43,10 @@ options:
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
8 changes: 7 additions & 1 deletion docs/commands/create-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ gitopscli create-preview \
```
usage: gitopscli create-preview [-h] --username USERNAME --password PASSWORD
[--git-user GIT_USER] [--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION --repository-name
REPOSITORY_NAME [--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
--preview-id PREVIEW_ID
--git-hash GIT_HASH --preview-id PREVIEW_ID
[-v [VERBOSE]]

options:
Expand All @@ -51,6 +53,10 @@ options:
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
12 changes: 9 additions & 3 deletions docs/commands/delete-pr-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ gitopscli delete-pr-preview \
```
usage: gitopscli delete-pr-preview [-h] --username USERNAME --password
PASSWORD [--git-user GIT_USER]
[--git-email GIT_EMAIL] --organisation
ORGANISATION --repository-name
REPOSITORY_NAME
[--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION
--repository-name REPOSITORY_NAME
[--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
--branch BRANCH
Expand All @@ -38,6 +40,10 @@ options:
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
6 changes: 6 additions & 0 deletions docs/commands/delete-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ gitopscli delete-preview \
```
usage: gitopscli delete-preview [-h] --username USERNAME --password PASSWORD
[--git-user GIT_USER] [--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION --repository-name
REPOSITORY_NAME [--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
Expand All @@ -36,6 +38,10 @@ options:
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
25 changes: 18 additions & 7 deletions docs/commands/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,37 @@ usage: gitopscli deploy [-h] --file FILE --values VALUES
[--single-commit [SINGLE_COMMIT]]
[--commit-message COMMIT_MESSAGE] --username USERNAME
--password PASSWORD [--git-user GIT_USER]
[--git-email GIT_EMAIL] --organisation ORGANISATION
--repository-name REPOSITORY_NAME
[--git-provider GIT_PROVIDER]
[--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION --repository-name
REPOSITORY_NAME [--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
[--create-pr [CREATE_PR]] [--auto-merge [AUTO_MERGE]]
[--merge-method MERGE_METHOD] [-v [VERBOSE]]
[--merge-method MERGE_METHOD] [--json [JSON]]
[--pr-labels PR_LABELS]
[--merge-parameters MERGE_PARAMETERS] [-v [VERBOSE]]

options:
-h, --help show this help message and exit
--file FILE YAML file path
--values VALUES YAML/JSON object with the YAML path as key and the desired value as value
--values VALUES YAML/JSON object with the YAML path as key and the
desired value as value
--single-commit [SINGLE_COMMIT]
Create only single commit for all updates
--commit-message COMMIT_MESSAGE
Specify exact commit message of deployment commit
--username USERNAME Git username (alternative: GITOPSCLI_USERNAME env variable)
--password PASSWORD Git password or token (alternative: GITOPSCLI_PASSWORD env variable)
--username USERNAME Git username (alternative: GITOPSCLI_USERNAME env
variable)
--password PASSWORD Git password or token (alternative: GITOPSCLI_PASSWORD
env variable)
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
6 changes: 6 additions & 0 deletions docs/commands/sync-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ gitopscli sync-apps \
```
usage: gitopscli sync-apps [-h] --username USERNAME --password PASSWORD
[--git-user GIT_USER] [--git-email GIT_EMAIL]
[--git-co-author-name GIT_CO_AUTHOR_NAME]
[--git-co-author-email GIT_CO_AUTHOR_EMAIL]
--organisation ORGANISATION --repository-name
REPOSITORY_NAME [--git-provider GIT_PROVIDER]
[--git-provider-url GIT_PROVIDER_URL]
Expand All @@ -117,6 +119,10 @@ options:
--git-user GIT_USER Git Username
--git-email GIT_EMAIL
Git User Email
--git-co-author-name GIT_CO_AUTHOR_NAME
Git Co-Author Name
--git-co-author-email GIT_CO_AUTHOR_EMAIL
Git Co-Author Email
--organisation ORGANISATION
Apps Git organisation/projectKey
--repository-name REPOSITORY_NAME
Expand Down
2 changes: 2 additions & 0 deletions gitopscli/cliparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def __add_git_credentials_args(deploy_p: ArgumentParser) -> None:
def __add_git_commit_user_args(deploy_p: ArgumentParser) -> None:
deploy_p.add_argument("--git-user", help="Git Username", default="GitOpsCLI")
deploy_p.add_argument("--git-email", help="Git User Email", default="[email protected]")
deploy_p.add_argument("--git-co-author-name", help="Git Co-Author Name")
deploy_p.add_argument("--git-co-author-email", help="Git Co-Author Email")


def __add_git_org_and_repo_args(deploy_p: ArgumentParser) -> None:
Expand Down
5 changes: 5 additions & 0 deletions gitopscli/commands/create_pr_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class Args(GitApiConfig):
git_user: str
git_email: str

git_co_author_name: Optional[str]
git_co_author_email: Optional[str]

organisation: str
repository_name: str

Expand All @@ -37,6 +40,8 @@ def execute(self) -> None:
password=args.password,
git_user=args.git_user,
git_email=args.git_email,
git_co_author_name=args.git_co_author_name,
git_co_author_email=args.git_co_author_email,
organisation=args.organisation,
repository_name=args.repository_name,
git_provider=args.git_provider,
Expand Down
13 changes: 11 additions & 2 deletions gitopscli/commands/create_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import shutil
from dataclasses import dataclass
from typing import Any, Callable
from typing import Any, Callable, Optional
from gitopscli.git_api import GitApiConfig, GitRepo, GitRepoApi, GitRepoApiFactory
from gitopscli.io_api.yaml_util import update_yaml_file, YAMLException, yaml_file_dump
from gitopscli.gitops_config import GitOpsConfig
Expand All @@ -17,6 +17,9 @@ class Args(GitApiConfig):
git_user: str
git_email: str

git_co_author_name: Optional[str]
git_co_author_email: Optional[str]

organisation: str
repository_name: str

Expand Down Expand Up @@ -82,7 +85,13 @@ def execute(self) -> None:
self.__deployment_updated_callback(gitops_config.get_updated_message(context))

def __commit_and_push(self, git_repo: GitRepo, message: str) -> None:
git_repo.commit(self.__args.git_user, self.__args.git_email, message)
git_repo.commit(
self.__args.git_user,
self.__args.git_email,
self.__args.git_co_author_name,
self.__args.git_co_author_email,
message,
)
git_repo.push()

def __get_gitops_config(self) -> GitOpsConfig:
Expand Down
6 changes: 6 additions & 0 deletions gitopscli/commands/delete_pr_preview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from typing import Optional
from gitopscli.git_api import GitApiConfig
from .delete_preview import DeletePreviewCommand
from .command import Command
Expand All @@ -10,6 +11,9 @@ class Args(GitApiConfig):
git_user: str
git_email: str

git_co_author_name: Optional[str]
git_co_author_email: Optional[str]

organisation: str
repository_name: str

Expand All @@ -27,6 +31,8 @@ def execute(self) -> None:
password=args.password,
git_user=args.git_user,
git_email=args.git_email,
git_co_author_name=args.git_co_author_name,
git_co_author_email=args.git_co_author_email,
organisation=args.organisation,
repository_name=args.repository_name,
git_provider=args.git_provider,
Expand Down
12 changes: 11 additions & 1 deletion gitopscli/commands/delete_preview.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import shutil
from typing import Optional
from dataclasses import dataclass
from gitopscli.git_api import GitApiConfig, GitRepo, GitRepoApiFactory, GitRepoApi
from gitopscli.gitops_config import GitOpsConfig
Expand All @@ -15,6 +16,9 @@ class Args(GitApiConfig):
git_user: str
git_email: str

git_co_author_name: Optional[str]
git_co_author_email: Optional[str]

organisation: str
repository_name: str

Expand Down Expand Up @@ -60,7 +64,13 @@ def __create_preview_target_git_repo_api(self, gitops_config: GitOpsConfig) -> G
)

def __commit_and_push(self, git_repo: GitRepo, message: str) -> None:
git_repo.commit(self.__args.git_user, self.__args.git_email, message)
git_repo.commit(
self.__args.git_user,
self.__args.git_email,
self.__args.git_co_author_name,
self.__args.git_co_author_email,
message,
)
git_repo.push()

@staticmethod
Expand Down
12 changes: 11 additions & 1 deletion gitopscli/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@


class DeployCommand(Command):
# pylint: disable=too-many-instance-attributes
@dataclass(frozen=True)
class Args(GitApiConfig):
git_user: str
git_email: str

git_co_author_name: Optional[str]
git_co_author_email: Optional[str]

organisation: str
repository_name: str

Expand Down Expand Up @@ -119,6 +123,12 @@ def __create_pull_request_title_and_description(self, updated_values: Dict[str,
return title, description

def __commit(self, git_repo: GitRepo, message: str) -> None:
commit_hash = git_repo.commit(self.__args.git_user, self.__args.git_email, message)
commit_hash = git_repo.commit(
self.__args.git_user,
self.__args.git_email,
self.__args.git_co_author_name,
self.__args.git_co_author_email,
message,
)
if commit_hash:
self.__commit_hashes.append(commit_hash)
Loading