-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated dev install and release docs
- Loading branch information
Showing
3 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
RELEASES | ||
-------- | ||
|
||
Releases are partially automated in BHIMA. This document is a checklist of things that need to be done | ||
before a release and the steps to creating a new release. | ||
Releases are partially automated in BHIMA. This document is a checklist of things that need to be done before a release and the steps to creating a new release. | ||
|
||
1. Make a new branch called `release-next` that is based on `upstream/master` to do your release on. If one exists on upstream, remove it first. | ||
2. Run `yarn` to ensure you have the latest dependencies. | ||
3. (Optional, best practice) Test the latest migration script on a production database. (*) | ||
4. (Optional, best practice) Build the application in production mode with `NODE_ENV=production yarn build`. | ||
5. Determine the version number for the next version. (v1.X.Y) | ||
6. Create a new folder in the `server/models/migrations/` directory to hold the migration file with the format `v1.A.B-v1.X.Y` where `1.A.B` is the current version and `v1.X.Y` is the next version. | ||
7. Move the `server/models/migrations/next/migrate.sql` file to the directory created in the above step. | ||
8. Create a blank `migrate.sql` file in `server/models/migrations/next/`. | ||
9. Commit updated files (git commit ...) | ||
10. Make sure your personal GITHUB_TOKEN environment variable is defined | ||
The directions below assume you are working in a development environment based on a fork of the main BHIMA repository on github. | ||
|
||
1. Checkout Bhima 'master' from your fork of https://github.com/IMA-WorldHealth/bhima | ||
2. Do `git pull` to make sure it is up-to-date. | ||
3. Create a new branch called `release-next` (for example) that is based on the upstream repo to do your release with. If one exists on upstream, remove it first. For example, if the main BHIMA githup repo is called `upstream` in your local development setup, do: | ||
- `git checkout -b release-next upstream/master` | ||
4. Run `yarn` to ensure you have the latest dependencies. | ||
5. (Optional, best practice) Test the latest migration script on a production database. (See * below) | ||
6. Build the application in production mode to make sure the build works correctly. | ||
- `NODE_ENV=production yarn build` | ||
7. Determine the version number for the next version (eg, `v1.X.Y`) | ||
8. Create a new folder in the `server/models/migrations/` directory to hold the migration file with the format `v1.A.B-v1.X.Y` where `1.A.B` is the current version and `v1.X.Y` is the next version. | ||
9. Move the `server/models/migrations/next/migrate.sql` file to the directory created in the previous step. | ||
10. Create an empty `migrate.sql` file in `server/models/migrations/next/`. You may insert a comment at the top of the file including the name of the new release version. | ||
11. Commit any updated files (`git commit ...`) | ||
12. Make sure your personal GITHUB_TOKEN environment variable is defined | ||
(assuming you have permissions to update the main BHIMA repository. [See Github instructions for this.](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) | ||
11. Run `yarn release` and follow the options. | ||
12. Verify the release was created and that the binary <version>.tar.gz file | ||
13. Run `yarn release` and follow the directions. | ||
14. Verify the release was created and that the binary <version>.tar.gz file | ||
is in the assets for the release. | ||
|
||
|
||
(*) Optional, Best Practice: Test the latest database changes on a production database. | ||
|
||
1. Change your `.env` so the `$DB_NAME` variable is the correct one for a production database. | ||
2. Create your database migration script by running `yarn migrate`. This will create a file `migration-$DB_NAME.sql`. | ||
3. Catenate the latest release file into the output `cat server/models/migrations/next/migrate.sql >> migration-$DB_NAME.sql`. | ||
4. Build the migration script targetting your database. `mysql $DB_NAME < migration-$DB_NAME.sql` | ||
2. Create your database migration script by running `yarn migrate`. This will create a release migration file `migration-$DB_NAME.sql`. | ||
3. Append the current migration file into the release migration file: | ||
- `cat server/models/migrations/next/migrate.sql >> migration-$DB_NAME.sql`. | ||
4. Build the migration script targetting your database. | ||
- `mysql $DB_NAME < migration-$DB_NAME.sql` | ||
5. If no errors occur, remove the file `migration-$DB_NAME.sql` to prevent it from getting checked into SQL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters