-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
-
Make sure your Java and sbt environment variables are set.
-
Fork the repository to your GitHub account.
-
Clone the repository.
git clone https://github.com/yourusername/femr.git
- After downloading MySQL, run the installer to install MySQL.
- Proceed through the installer and make a note of the username and password you set.
- It is recommended to install MySQL Workbench, the official GUI for your MySQL database.
- Run MySQL Workbench and you should see your MySQL database running as localhost. Select your database and create a new schema by clicking one of the icons on the top toolbar. Name it whatever you want, but make note of it for later.
- Navigate to the Session tab in the lower left corner. Take note of your Host and Port. The default should be localhost and 3306.
- Open IntelliJ and close any active projects.
- A project selector window will pop up, click Configure and then Plugins.
- Search for Scala plugin and install.
- Back on the project selector window, click Import Project.
- Navigate to where you cloned fEMR, and click Open.
- Select 'Import project from external model'
- Select 'SBT'
- Click Next
- Ensure the Project SDK is java version 1.8, click Finish.
- Create a file named application.dev.conf in the conf folder, copy and paste the information from application.example.conf in it. Change the db.default fields to match your database address, username, and password that you noted before. Change the same fields in application.conf as well. Example with database named femr, database located at localhost with port 3306, username and password both root: db.default.url="jdbc:mysql://127.0.0.1:3306/femr?characterEncoding=UTF-8" db.default.username="root" db.default.password=“root"
- Under Run, select Edit configurations. Create a new Play 2.0 application and add the following environment variables using your absolute filepath to the file: [config.file // /absolute/location/to/conf/application.dev.conf] [user.dir // /absolute/location/to/femr]
- Run
- Contact [email protected] for an IntelliJ IDEA liscense key or with any issues configuring IntelliJ.
Unless you are working on a bug in a specific release, always create a branch from master. Each JIRA issue should have its own branch. JIRA issues have 4 categories. To create a working branch before working on an issue:
- features:
git checkout master
git checkout -b feature-[JIRA_ID]-[briefDescriptionOfFeature]
- bugs:
git checkout master
git checkout -b bug-[JIRA_ID]-[briefDescriptionOfBug]
- improvements:
git checkout master
git checkout -b improvement-[JIRA_ID]-[briefDescriptionOfImprovement]
- tasks:
git checkout master
git checkout -b task-[JIRA_ID]-[briefDescriptionOfTask]
Example:
git checkout -b feature-FEMR832-fixingEverythingEverywhere
Always sync your fork's (username/femr) master branch with the project's (femr/femr) master branch. If your working branch begins to deviate too far from master, merging will becoming increasingly difficult. This ensures that your work remains in sync with everyone else's work:
- List your current remotes to see if you have one pointing upstream to the main project repository (femr/femr):
git remote -v
- If you do not, add one:
git remote add upstream https://github.com/femr/femr.git
- Sync your updated local master branch with your fork's master branch:
git checkout master
git pull upstream master
git push origin master
If you have committed your work to master, you will run into issues here. Move your work to a separate working branch and get a fresh copy of the master branch.
-
This step requires rebasing. Sync your working branch with your fork and rebase new code into your working branch: git checkout [issueBranchName] git push origin [issueBranchName] git rebase master
-
After confirming your code was properly merged and that the rebase was successful, sync the new branch with your fork: git checkout [issueBranchName] git push -f origin [issueBranchName]
Note the '-f' option for push in Step 5. This forces a push because the rebase has altered your commit history. Anyone else that was using your branch will need to delete it and pull down a fresh copy.
Submit your code for review to be accepted into the main project repository (femr/femr) by sending a Pull Request from your fork on GitHub:
-
Update your branch with the newest code by syncing master and then rebasing your working branch. See Step 4 and Step 5 in the previous section to complete this.
-
Initiating a pull request:
Initiate a pull request from your fork's (username/femr) working branch into the main repository's (femr/femr) master branch.
-
If your Pull Request is Accepted git checkout master git pull upstream master
-
If your Pull Request requires additional commits you can add them to your branch and push to your fork. They will automatically be updated in the Pull Request.
git checkout [issueBranchName]
~~~make changes, commit them~~~
git push origin [issueBranchName]
- If your Pull Request is Rejected
git checkout master
git pull upstream master
git checkout [issueBranchName]
git rebase master
~~~fix issues~~~
git checkout master
git pull upstream master
git checkout [issueBranchName]
git rebase master
git push -f origin [issueBranchName]
- Delete your branch locally:
git branch -d [issueBranchName]
- Delete your branch from your fork:
git push origin :[issueBranchName]