# Dashboard branch management & Bamboo deployment

**URL:** <https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224>\
**Category:** ID Dashboard\
**Created:** [June 19, 2015, 3:37pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224 "2015-06-19T15:37:38Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliott](https://talk.openmrs.org/user_avatar/talk.openmrs.org/elliott/32/965_2.png) [@elliott](https://talk.openmrs.org/u/elliott)\
**Post date:** [June 19, 2015, 5:56am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/1 "2015-06-19T05:56:38Z")

</div>

Off topic, but I would be willing to help set up Bamboo to have an actual deploy pipeline for the dashboard. The current system of manually git pulling on production seems to cause a lot of friction that leads to infrequent prod pushes and difficult fixing small problems like this one.

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [June 19, 2015, 7:22am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/2 "2015-06-19T07:22:30Z")

</div>

Let’s keep a branch which we can use for active development and then periodically merge something to a branch which is always kept in a stable state…I brought the codebase into an inconsistent state when I was merging changes which changed small parts of the system and then had to make other changes…I vote the following:

- **master** will be the branch which we will deploy – rebase that onto **production**
- **develop** is the place where things can be broken and when fixed, we just need to remember to merge and/or rebase onto **master**.
- never _ever ever ever_ commit development code to **production**

---

<div class="post-metadata">

**Author:** ![michael](https://talk.openmrs.org/user_avatar/talk.openmrs.org/michael/32/15070_2.png) [@michael](https://talk.openmrs.org/u/michael)\
**Post date:** [June 19, 2015, 3:38pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/3 "2015-06-19T15:38:27Z")

</div>

👍 to getting this automated via Bamboo. Dashboard needs to be highly reliable and should never be pushed without as much testing as we can reasonably manage. 😄

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [June 19, 2015, 8:33pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/4 "2015-06-19T20:33:36Z")

</div>

That’s why I think **develop** (which CAN be in a messy state for a short period) and then when it’s reasonably stable…move to **master** which bamboo then rebases over **production**. Just my $0.02 on this matter…i’m planning on having master in a deployable state soon! Hopefully not making things too complex – just a middle-ground approach.

bold-faced are the branch names so it’s easy to see at a glance.

---

<div class="post-metadata">

**Author:** ![cintiadr](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cintiadr/32/8081_2.png) [@cintiadr](https://talk.openmrs.org/u/cintiadr)\
**Post date:** [June 20, 2015, 12:25am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/5 "2015-06-20T00:25:35Z")

</div>

For that it’s worth, when doing a git operation in a script task after a checkout in Bamboo, make sure to do

```
git remote set-url origin ${bamboo.planRepository.repositoryUrl} 

```

There’s a non supported plugin to do that as well, but I didn’t have a nice experience with it.

Also, there are a few tasks to handle variables in Bamboo, to increase them and everything, but you can use the buildNumber instead if desired.

---

<div class="post-metadata">

**Author:** ![elliott](https://talk.openmrs.org/user_avatar/talk.openmrs.org/elliott/32/965_2.png) [@elliott](https://talk.openmrs.org/u/elliott)\
**Post date:** [June 20, 2015, 7:05pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/6 "2015-06-20T19:05:00Z")

</div>

In your mind, what are the criteria for moving commits from `develop` to `master`? Does having `develop` mean code isn’t originally being written in feature branches?

---

<div class="post-metadata">

**Author:** ![elliott](https://talk.openmrs.org/user_avatar/talk.openmrs.org/elliott/32/965_2.png) [@elliott](https://talk.openmrs.org/u/elliott)\
**Post date:** [June 20, 2015, 7:20pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/7 "2015-06-20T19:20:56Z")

</div>

Here’s the branch organization I usually prefer. All new code is written in feature branches. Each feature branch corresponds to a ticket.

```auto

    Development Deployment
    ----------- ----------
                    |
                    |
       master ======> production
        ^ |        
        | |       
        |<-feature |        
        | |
        |<-feature |
        | |
        |<-feature |
                    |

```

The upside of this is that it forces every feature/ticket to be totally complete before it is merged with master, and thus master stays pretty stable. (if testing is good enough, master could be the deploy branch itself). The downside is that feature branches can inevitably become pretty huge. (I’m reminded of last summer when the ID Dashboard’s new datastore and models came in a single pull request!)

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [June 20, 2015, 8:27pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/8 "2015-06-20T20:27:10Z")

</div>

This could work…I like it better…however things like GCI happens – which is why master is currently in a state of flux – hence **develop** would exist to allow for merging easily without mucking up **master** , as has already happened. What we could do is a branch like **gci2015** and use that to merge things piecemeal, but the end result is the same as **develop** ; which means that it’s going to or may be unstable for a period of time (which is _ **hopefully** _ short). The determining factor for moving from **develop** -\> **master** is _ **VERY** _ subjective.

---

<div class="post-metadata">

**Author:** ![plypy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/plypy/32/505_2.png) [@plypy](https://talk.openmrs.org/u/plypy)\
**Post date:** [June 27, 2015, 6:36am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/9 "2015-06-27T06:36:03Z")

</div>

Hi there… I’ve just checked the status of Dashboard, it is not changed.

We can’t just talk, somebody should move. Create a production branch and merge my ‘production’ branch [here](https://github.com/Plypy/openmrs-contrib-id/tree/production), which with fix, and deploy it.

Can somebody with proper privileges stand out? @michael @r0bby @elliott @ryan

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [June 27, 2015, 8:38am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/10 "2015-06-27T08:38:45Z")

</div>

I do not have privileges.

I created a branch, which is (as far as I know) what’s running live on the server right now. When we release the new one, I’ll rebase master over that branch, but that branch will **ALWAYS** be in a clean state and reflects what is running on the production server (or what will shortly be deployed to the production server).

It is called `production` and is branched from commit [00c223e](https://github.com/Plypy/openmrs-contrib-id/tree/00c223eef3b9bdbe4b123ed5ce700353e6cca2ae). Currently, I cherrypicked two commits: [963b129](https://github.com/openmrs/openmrs-contrib-id/commit/963b12973847f4b13fd4835f8a6576d798c8c142) and [963b129](https://github.com/openmrs/openmrs-contrib-id/commit/2fde4b0aaff56c81bc1fd52615093a0d9572baff) into that branch.

`master` is slowly returning to a stable state 😃 – I have some time on my hands and may tackle the sign up page myself. @plypy’s GSoC contributions are improving code quality and are being merged as I review them.

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [June 27, 2015, 8:02pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/11 "2015-06-27T20:02:55Z")

</div>

I created a tag `v2.0.1` and `production` can be deployed safely. `production` is currently 2 commits ahead of what’s deployed (@plypy’s fixes).

In addition to this, all modules are stable and can be deployed as git submodules. None of those were touched. This includes the globalnavbar.If you want, I can cherrypick the commits from GSoc so that they can be deployed immediately (opinions on this @elliott, @michael?)

---

<div class="post-metadata">

**Author:** ![michael](https://talk.openmrs.org/user_avatar/talk.openmrs.org/michael/32/15070_2.png) [@michael](https://talk.openmrs.org/u/michael)\
**Post date:** [July 1, 2015, 9:18pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/12 "2015-07-01T21:18:05Z")

</div>

Can you clarify what permissions you need on the repository?

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [July 2, 2015, 2:07am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/13 "2015-07-02T02:07:08Z")

</div>

What? Did you mean to address this to @plypy?

---

<div class="post-metadata">

**Author:** ![michael](https://talk.openmrs.org/user_avatar/talk.openmrs.org/michael/32/15070_2.png) [@michael](https://talk.openmrs.org/u/michael)\
**Post date:** [July 2, 2015, 12:17pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/14 "2015-07-02T12:17:33Z")

</div>

> [@r0bby](#):
>
> I do not have privileges.

I don’t know what this means but am happy to help you get those privileges.

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [July 3, 2015, 2:14am UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/15 "2015-07-03T02:14:06Z")

</div>

Oh, to deploy and add @plypy’s changes – he’s made modifications which I cherrypicked into the `production` branch. You could probably do it – but we really should set up CI to deploy the `production` branch if it detects a commit. Automation is best for this.

---

<div class="post-metadata">

**Author:** ![ryan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ryan/32/8087_2.png) [@ryan](https://talk.openmrs.org/u/ryan)\
**Post date:** [July 8, 2015, 5:25pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/16 "2015-07-08T17:25:37Z")

</div>

I would say yes to automatically deploy to the staging environment, but have a manual step to deploy to prod. @elliott set up something like this for modulus and I think we should try to replicate that.

---

<div class="post-metadata">

**Author:** ![r0bby](https://talk.openmrs.org/user_avatar/talk.openmrs.org/r0bby/32/6479_2.png) [@r0bby](https://talk.openmrs.org/u/r0bby)\
**Post date:** [July 8, 2015, 9:39pm UTC](https://talk.openmrs.org/t/dashboard-branch-management-bamboo-deployment/2224/17 "2015-07-08T21:39:00Z")

</div>

The `production` branch is ready to deploy…it has 2 fix commits which I cherry-picked. Currently, @plypy is rewriting the views in [jade](http://jade-lang.com) - I’m happy about this. Hopefully, by the close of GSoC – we _SHOULD_ be in a stable state. He’s done an amazing amount of work – and high quality too. If somebody wants to (or can) – do a pull of the [production branch](https://github.com/openmrs/openmrs-contrib-id/tree/production) – it’s branched from what is running on the server currently…you might want to hard reset to [00c223e](https://github.com/openmrs/openmrs-contrib-id/commit/00c223eef3b9bdbe4b123ed5ce700353e6cca2ae) (`git reset --hard 00c223e`) so that there are not merge conflicts – @plypy made a change which will conflict with a patch @michael made switching the URL for OpenMRS Ask. We should deploy this ASAP.
