Skip to content

Commit 85df64a

Browse files
committed
fix endpoint tracing on deploy
1 parent 4d9bd0b commit 85df64a

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

packages/cli/src/deploy/command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import * as o2 from '../projects/options';
88
export type DeployOptions = Required<
99
Pick<
1010
Opts & POpts,
11+
| 'endpoint'
12+
| 'apiKey'
1113
| 'beta'
1214
| 'command'
1315
| 'configPath'

packages/cli/src/deploy/handler.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,15 @@ const redirectTov2 = async (
118118

119119
// default endpoint to one from openfn.yaml
120120
const v2config = yamlToJson(await fs.readFile(v2ConfigPath, 'utf-8'));
121-
if (!config.endpoint && v2config?.project?.endpoint) {
122-
config.endpoint = v2config.project.endpoint;
123-
}
121+
const endpoint =
122+
options.endpoint ?? v2config?.project?.endpoint ?? config.endpoint;
124123

125124
return beta.handler(
126125
{
127126
...options,
128127
force: true,
129-
endpoint: config.endpoint,
130-
apiKey: config.apiKey ?? undefined,
128+
endpoint,
129+
apiKey: options.apiKey ?? config.apiKey ?? undefined,
131130
},
132131
logger
133132
);

packages/cli/src/projects/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const syncProjects = async (
148148
// TODO should we prefer endpoint over alias?
149149
// maybe if it's explicitly passed?
150150
const endpoint = trackedProject.openfn?.endpoint ?? config.endpoint;
151-
151+
console.log({ config });
152152
const { data } = await fetchProject(
153153
endpoint,
154154
config.apiKey,

packages/cli/src/projects/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export async function fetchProject(
121121
): Promise<{ data: Provisioner.Project | null }> {
122122
const url = getLightningUrl(endpoint, projectId, snapshots);
123123
logger?.info(`Checking ${url} for existing project`);
124-
124+
console.log({ apiKey });
125125
try {
126126
const response = await fetch(url, {
127127
headers: {

0 commit comments

Comments
 (0)