You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These new sub-commands simplify the interface when promoting between
branches in a repository, between environments in a repository, or
between two "simple" repositories. The previous behavior is preserved if
no sub-command is given: the user can specify any combination of
repository, branch and environment folder (even a local repo).
For #92
--keep-cache whether to retain the locally cloned repositories in the cache directory
84
98
--repository-type string the type of repository: github, gitlab or ghe (default "github")
85
-
--service string service name to promote
86
-
--to string destination Git repository
87
-
--to-branch string branch on the destination Git repository (default "master")
88
-
89
-
Global Flags:
90
-
--github-token string oauth access token to authenticate the request
91
99
```
92
100
93
101
This will _copy_ all files under `/services/service-a/base/config/*`in`first-environment` to `second-environment`, commit and push, and open a PR for the change. Any of these arguments may be provided as environment variables, using all upper case and replacing `-` with `_`. Hence you can set CACHE_DIR, COMMIT_EMAIL, etc.
@@ -99,15 +107,27 @@ This will _copy_ all files under `/services/service-a/base/config/*` in `first-e
99
107
- `--commit-name` : The other half of `commit-email`. Both must be set.
100
108
- `--debug` : prints extra debug output if true.
101
109
- `--from` : an https URL to a GitOps repository for 'remote' cases, or a path to a Git clone of a microservice for 'local' cases.
110
+
- `--from-env` : use this to specify an environment folder in the source repository, for when you have more than one environment per repository. If this is not provided when the repository has more than one folder under `environments/`, then the operation will fail.
102
111
- `--from-branch` : use this to specify a branch on the source repository, instead of using the "master" branch.
103
112
- `--help`: prints the above text if true.
104
113
- `--insecure-skip-verify` : skip TLS cerificate verification if true. Do not set this to true unless you know what you are doing.
105
114
- `--keep-cache` : `cache-dir` is deleted unless this is set to true. Keeping the cache will often cause further promotion attempts to fail. This flag is mostly used along with `--debug` when investigating failure cases.
106
115
- `--repository-type` : the type of repository: github, gitlab or ghe (default "github"). If `--from` is a Git URL, it must be of the same type as that specified via `--to`.
107
116
- `--service` : the destination path for promotion is `/environments/<env-name>/services/<service-name>/base/config/`. This argument defines `service-name` in that path.
108
117
- `--to`: an https URL to the destination GitOps repository.
118
+
- `--to-env` : use this to specify an environment folder in the destination repository, for when you have more than one environment per repository. If this is not provided when the repository has more than one folder under `environments/`, then the operation will fail.
109
119
- `--to-branch` : use this to specify a branch on the destination repository, instead of using the "master" branch.
110
120
121
+
### Promote Sub-commands
122
+
The main promote commands provides a lot of flexibility with all of its options, but the subcommands provide a simpler interface for the usual promotion paths. For example, when promoting between environment folders in the same repository and branch, you could use either of these commands:
promoteCmd.Flags().String(fromFlag, "", "the source Git repository (URL or local)")
42
+
promoteCmd.Flags().String(toFlag, "", "the destination Git repository")
43
+
promoteCmd.Flags().String(serviceFlag, "", "the name of the service to promote")
44
+
promoteCmd.Flags().String(fromBranchFlag, "master", "the branch on the source Git repository")
45
+
promoteCmd.Flags().String(fromEnvFolderFlag, "", "env folder on the source Git repository (if not provided, the repository should only have one folder under environments/)")
46
+
promoteCmd.Flags().String(toBranchFlag, "master", "the branch on the destination Git repository")
47
+
promoteCmd.Flags().String(toEnvFolderFlag, "", "env folder on the destination Git repository (if not provided, the repository should only have one folder under environments/)")
0 commit comments