How to build a Bahmni package with Gradle?

Hi Bahmni team!

I have customized some of the Bahmni package components, for instance Bahmni-web.

Now I’d like to build it as a RPM.

I have never used Gradle before (sorry if I miss something obvious then).

From the repo root directory:

cd bahmni-web/

Then

gradle buildRpm

But got error:

:bahmni-web:extractBahmniApps FAILURE: Build failed with an exception.

What went wrong: Cannot expand ZIP ‘/home/romain/repos/bahmni/bahmni-package/bahmni-web/resources/bahmniapps.zip’ as it does not exist.

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.03 secs

Obviously missing some pre-build steps to fetch bahmniapps.zip

(Q) What should I do to build a bahmni package as RPM?

You are right. It expects bahmniapps.zip to be present in resources folder.

you can download from GitHub - Bahmni/openmrs-module-bahmniapps: Angular.JS based UI application that is used by Clinicians and Patient care providers.

:slight_smile: ok thanks. I just though there was some automated Gradle build task that would fetch this artifact for me.

Yes, our CI pipelines does this automatically… since you are locally building this is a manual step

@sravanthi17, I can’t find the zip file from there. Building the project doesn’t output a zip file either.

Is this zip file simply an archive of the openmrs-module-bahmniapps/ui/dist/ folder?

Or is there a way to directly download it from your CI? Is it accessible to the public?

(When I try accessing https://ci-bahmni.thoughtworks.com/, I get 503 - Service Temporarily Unavailable)

The URL of CI server is: https://ci.mybahmni.org/go/auth/login (requires to use Github ID).

We will try and add a redirect so that people who have the old URL can be redirected to this new URL automatically.

@gsluthra, thanks, but same error on https://ci.bahmni.thoughtworks.com/

(Also I had to manually allow the untrusted TLS certificate)

Sorry. I updated the URL.

OK thanks @gsluthra, that works. But my GitHub ID (rbuisson) does not allow me to login. Anything I need to configure on my side?

Once you login using your github creds, you should be able to submit a request for access. Can you please try that out.

I can’t even pass the first login screen:

It always fails.

I tried with email address too, doesn’t work either. By GitHub ID, do you mean the actual ID behind my GitHub user (like shown here: https://api.github.com/users/rbuisson)?

Please click on the highlight icon in the image, which will redirect to github and you have to key in your github credentials.

@gsluthra, isn’t what @mksrom needs simply what is built and available in the ui/dist folder as a zip file? If he already has this built, does he need to download a different artifact?

@mseaton, yes, that’s right bahmniapps.zip is simply an archive of the ui/dist folder. :slight_smile: so I am not blocked in my work now. The thing is I would prefer to get this file from an external source than having to fetch the code repo, build on the right branch and then archive. That is why I still would like to have a look at the Bahmni CI.

thanks @senthilrajar :slight_smile: I now have access.