Skip to content

Commit

Permalink
add screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ritazagoni committed Sep 28, 2024
1 parent c90ce1c commit 5971d33
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/manage-projects/staging-prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ It's a safe and efficient practice to use separate production and staging/testin

1. First, create a Production and a Staging project on OpenFn

![Configure](/img/connect-account-to-github.png)
![Prod and Staging Projects](/img/openfn_prod_staging.png)

2. Choose/create a GitHub repo for your project, and create a staging branch

![Configure](/img/connect-account-to-github.png)
![Prod and Main Branches](/img/staging_prod_branches_gh.png)

3. Connect your projects to the main and staging respectively - use [this guide](../manage-projects/link-to-gh.md) to set up the connection
4. In each repo, create an empty .js file for your job. Make sure they have the same name and path on each repo (e.g. `upsert-contacts.js`). These will store the code for the job they'll be linked to in the next step.

5. When you connected the branches to your projects in step 3 above, there was a `spec.yaml` file automatically created on the branch after the first sync (along with two other configuration files). Open these files on GitHub, and locate your job. Replace the contents of `body` with: `path: {path to the related js file}`
5. When you connected the branches to your projects in step 3 above, there was a `spec.yaml` file automatically created on the branch after the first sync (along with two other configuration files). Open these files on GitHub, and locate your job in the file. Replace the contents of `body` with: `path: {path to the related js file}`. Do this on both your `main` and `staging` branches.

![Configure](/img/connect-account-to-github.png)
![Configure](/img/path_main.png)
![Configure](/img/path_staging.png)

6. You're now set up!
6. You're now all set up!
7. To sync a change from your staging project to production, go to your staging project on OpenFn and make edits to your job.
8. Then go to Settings > Synch to GitHub, and click Initiate Sync to Branch
9. Head over to GitHub. On your staging branch you'll see an update that there have been recent changes. Click `Compare & pull request`
![Configure](/img/connect-account-to-github.png)

![Configure](/img/staging_pushes.png)

from staging to prod: make change, create PR with only the js
8. deployed automatically when merged
8. Your changes are deployed automatically to your OpenFn prod project when the Pull Request is merged on GitHub.
Binary file added static/img/openfn_prod_staging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/path_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/path_staging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/staging_prod_branches_gh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/staging_pushes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5971d33

Please sign in to comment.