MCPcopy Create free account
hub / github.com/conforma/cli / variables

Function variables

acceptance/cli/cli.go:84–140  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

82}
83
84func variables(ctx context.Context) (context.Context, []string, map[string]string, error) {
85 // environment that the ec command line will run with
86 // we need to keep the $PATH, otherwise go-getter could
87 // fail if it can't locate the git command
88 environment := []string{
89 "PATH=" + os.Getenv("PATH"),
90 "GOCOVERDIR=" + os.Getenv("GOCOVERDIR"), // directory where the Go coverage raw data is stored
91 "HOME=/tmp",
92 }
93
94 // variables that can be substituted on the command line
95 // provided by the `parameters`` parameter
96
97 ctx, tmpdir := testenv.TempDir(ctx)
98 vars := map[string]string{
99 "TMPDIR": tmpdir,
100 }
101
102 var err error
103 if environment, vars, err = setupKubernetes(ctx, vars, environment); err != nil {
104 return ctx, nil, nil, err
105 }
106
107 if environment, vars, err = setupRegistry(ctx, vars, environment); err != nil {
108 return ctx, nil, nil, err
109 }
110
111 if environment, vars, err = setupRekor(ctx, vars, environment); err != nil {
112 return ctx, nil, nil, err
113 }
114
115 if environment, vars, err = setupKeys(ctx, vars, environment); err != nil {
116 return ctx, nil, nil, err
117 }
118
119 if environment, vars, err = setupSigs(ctx, vars, environment); err != nil {
120 return ctx, nil, nil, err
121 }
122
123 if environment, vars, err = setupGitHost(ctx, vars, environment); err != nil {
124 return ctx, nil, nil, err
125 }
126
127 if environment, vars, err = setupTUF(ctx, vars, environment); err != nil {
128 return ctx, nil, nil, err
129 }
130
131 if environment, err = setupCmdEnvironmentVariable(ctx, environment); err != nil {
132 return ctx, nil, nil, err
133 }
134
135 if vars, err = setupCliVersion(ctx, vars); err != nil {
136 return ctx, nil, nil, err
137 }
138
139 return ctx, environment, vars, nil
140}
141

Callers 2

ecCommandIsRunWithFunction · 0.85
createGenericFileFunction · 0.85

Calls 10

TempDirFunction · 0.92
setupKubernetesFunction · 0.85
setupRegistryFunction · 0.85
setupRekorFunction · 0.85
setupKeysFunction · 0.85
setupSigsFunction · 0.85
setupGitHostFunction · 0.85
setupTUFFunction · 0.85
setupCliVersionFunction · 0.85

Tested by

no test coverage detected