Skip to content

CLI: Deploy straight from yaml - #1481

Draft
josephjclark wants to merge 10 commits into
mainfrom
checkout-project-yaml
Draft

CLI: Deploy straight from yaml#1481
josephjclark wants to merge 10 commits into
mainfrom
checkout-project-yaml

Conversation

@josephjclark

@josephjclark josephjclark commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Short Description

This PR enables users to run a deploy from a file: either an exported project.yaml (from the app) or from A single v2 state file (the thing created when fetching a project).

openfn project deploy .projects/main@app.openfn.org.yaml --name my-new-project

Note that if you try and deploy a project to the same instance and the same UUID, it'll just override. In this case you have to pass --new or set a new name.

A side-effect of this work is that you can now edit a local project.yaml file and deploy it directly to lightning - previously the CLI didn't allow this because a deploy would re-build the project.yaml from the local filesystem. Being able to modify the yaml directly is probably a useful escape hatch. But one I'll leave undocumented for now.

Fixes #1264

QA Notes

To test this ( I recommend running against local or at least staging)

You can set OPENFN_ENDPOINT and OPENFN_API_KEY env vars to configure deploy targets and access and stuff. .env files work.

Scenario 1 - deploy an exported project

  • Go to any project in the app and export it as yaml
  • copy the path to the file
  • With a superuser API token, deploy that file to an instance: openfn project deploy downlaoded-project.yaml --name my-duplicate
  • The project should exist on the target server
  • Should work with whatever name you pass, or no name
  • Should work on the same instance as you exported from, or a different one

Scenario 2 - re-deploy an existing project

  • Fetch a project: openfn project pull <uuid> --alias og
  • Note that you'll now have a file like og@app.openfn.org.yaml
  • Now, with a superuser API token, deploy that file back: openfn project deploy ./projects/og@app.openfn.org.yaml --name my-duplicate
  • Should work with whatever name you pass, or no name
  • Should work on the same instance as you exported from, or a different one

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation Bot moved this to New Issues in Core Jul 15, 2026
josephjclark and others added 2 commits September 2, 2026 15:39
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@josephjclark

Copy link
Copy Markdown
Collaborator Author

Right something I need to think about here

if you post a yaml directly, how do we know it's a new project and you don't just want to force push an update?

Presumanly you should be able to manuaally edit the yaml file and force push it from the file. A regular deploy will update from the file system but why not just edit the yaml?

You can pass --new to force it but eh it should be obvious right? The project is new if either

  • You are posting with a different name
  • You are posting to a different domain

So let's add a little automation around that

@josephjclark

Copy link
Copy Markdown
Collaborator Author

@midigofrank just a headsup that I'm close to getting this closed out - expecting to release tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Deploy: allow deploy straight from project.yaml

2 participants