1 | import { ProjectOperationCredentials, RemoteRepoRef, RepoRef, ScmProviderType } from "@atomist/automation-client";
|
2 | /**
|
3 | * Information needed to create a proper RemoteRepoRef for the
|
4 | * [[SdmPackK8sOptions.syncRepo]]. If `apiBase` and `providerType`
|
5 | * are not provided, cortex is queried to find the information.
|
6 | */
|
7 | export interface SyncRepoRef extends RepoRef {
|
8 | /**
|
9 | * Root API URL. Default is dependent on [[providerType]]. This
|
10 | * value is typically not set but rather looked up in cortex.
|
11 | */
|
12 | apiBase?: string;
|
13 | /**
|
14 | * If branch is provided, it is used. If it is not provided,
|
15 | * things get complicated. If the repo exists in the graph and it
|
16 | * has the defaultBranch property set, then the defaultBranch is
|
17 | * used. If the repo does not exist in the graph or its
|
18 | * defaultBranch property is not set, "master" is used. Since the
|
19 | * repo defaultBranch property could not be set initially but get
|
20 | * set at a later time, how sync repo behaves can change even if
|
21 | * the configuration does not. Long story short, even though
|
22 | * branch is optional, set it if you want sync repo to behave
|
23 | * deterministically.
|
24 | */
|
25 | branch?: string;
|
26 | /**
|
27 | * Git SDM provider, e.g., "github_com". Typically this value is
|
28 | * not set and looked up in cortex.
|
29 | */
|
30 | providerType?: ScmProviderType;
|
31 | }
|
32 | /**
|
33 | * Configuration options for sync mode operation.
|
34 | */
|
35 | export interface SyncOptions {
|
36 | /**
|
37 | * To synchronize resources in k8s cluster with a Git repo,
|
38 | * provide a repo ref as the value of this property. The value
|
39 | * can be either a SyncRepoRef or RemoteRepoRef. On startup, the
|
40 | * contents of this repo ref will be synchronized with the
|
41 | * cluster, subsequent changes to this repo will be syncronized to
|
42 | * the cluster, and subsequent resource deployments will update
|
43 | * the contents of this repo.
|
44 | *
|
45 | * If a SyncRepoRef is provided, on startup cortex is queried to
|
46 | * find the details of the repo needed to create a RemoteRepoRef.
|
47 | * This RemoteRepoRef is created and then used as the value of
|
48 | * this property for the lifetime of the SDM.
|
49 | *
|
50 | * If a RemoteRepoRef is provided, it is used as is.
|
51 | */
|
52 | repo: SyncRepoRef | RemoteRepoRef;
|
53 | /**
|
54 | * Credentials to use when cloning the sync.repo. These are
|
55 | * typically not provided in the SDM configuration, rather they
|
56 | * are are obtained during startup by the SDM via a cortex query.
|
57 | * If they are provided, the provided credentials are used rather
|
58 | * than any returned from cortex.
|
59 | */
|
60 | credentials?: ProjectOperationCredentials;
|
61 | /**
|
62 | * Key to use to encrypt Kubernetes Secret resource values before
|
63 | * storing them in the sync repo and decrypt them when reading
|
64 | * them from the sync repo. If it is not provided, secrets are
|
65 | * not encrypted in the sync repo, so hopefully they aren't too
|
66 | * secret.
|
67 | *
|
68 | * You can use the bin/secret.js script bundled with this package
|
69 | * to manually encrypt and decrypt values using the same strategy.
|
70 | */
|
71 | secretKey?: string;
|
72 | }
|
73 | /**
|
74 | * Configuration options to be passed to the extension pack creation.
|
75 | */
|
76 | export interface SdmPackK8sOptions {
|
77 | /**
|
78 | * Whether to add the undelete command. Typically you would only
|
79 | * want to enable this in one SDM per workspace. If no value is
|
80 | * provided, the comand is not added.
|
81 | */
|
82 | addCommands?: boolean;
|
83 | /**
|
84 | * Whether to register and converge a k8s cluster. Typically this
|
85 | * is used from k8s-sdm to manage k8s cluster it is running in.
|
86 | */
|
87 | registerCluster?: boolean;
|
88 | /**
|
89 | * Synchronize resources in k8s cluster with a Git repo.
|
90 | */
|
91 | sync?: SyncOptions;
|
92 | }
|
93 | /** Validate the the partial SyncOptions contains a repo property. */
|
94 | export declare function validSyncOptions(o: Partial<SyncOptions>): o is SyncOptions;
|