[FOLIO-347] Create Jenkins build environment for Gradle and Groovy Created: 06/Oct/16 Updated: 12/Nov/18 Resolved: 27/Oct/16 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P3 |
| Reporter: | John Malconian | Assignee: | John Malconian |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 3 days, 3 hours | ||
| Original estimate: | Not Specified | ||
| Sprint: |
| Description |
|
Create a Docker-based Jenkin's slave build environment for Gradle and Groovy-based projects like mod-metadata. |
| Comments |
| Comment by John Malconian [ 07/Oct/16 ] |
|
I'm able to run a 'gradle build' inside a custom docker container that contains a full build environment. I'm having issues, however, understanding how to implement user-specific settings in gradle. Specifically, I want all maven artifacts downloaded from a local repository (that acts as a proxy). From what I could find using Google, I should be able to do this using a gradle init file. Created the following file as $HOME/.gradle/init.gradle: allprojects {
ext.RepoConfigurator = {
maven {
credentials {
username "$nexusUsername"
password "$nexusPassword"
}
url = uri('http://nexus:8081/repository/maven-public')
}
}
buildscript.repositories RepoConfigurator
repositories RepoConfigurator
}
It seems 'gradle build' either ignores this file or it is not doing what I had hoped. Artifacts are downloaded directly from Maven Central. |
| Comment by Marc Johnson [ 10/Oct/16 ] |
|
Hi John, Thank you for looking into this. Is that repository available publicly, if so, it could be one of the sources in the primary gradle files for the modules themselves, that would be respected I think? Hugs, Marc |
| Comment by John Malconian [ 11/Oct/16 ] |
|
This particular repository requires authentication. It essentially acts as a proxy to other public Maven repos so that the build system doesn't need to download artifacts from the origin sites every time a build is initiated. I don't cache things locally on the filesystem so that we get "clean" builds each time. For Maven builds, the build user uses a user-specific 'settings.xml'. I have to think Gradle has some sort of equivalent to this. |
| Comment by John Malconian [ 14/Oct/16 ] |
|
Finally figured out how to configure global Gradle settings to use a local Maven repository as well as an issue involving deploying Docker containers as Jenkins slave nodes. At this point, the job performs a successful 'gradle build' as well as generate the API documentation and uploads the docs to the S3 webserver. I've created links on the Dev website to point to the mod-metadata docs here: http://dev.folio.org/doc/ . Last steps are to automatically build and deploy mod-metadata Docker images to Docker Hub and set up job notifications. |
| Comment by Marc Johnson [ 15/Oct/16 ] |
|
Brilliant, thanks John |
| Comment by John Malconian [ 27/Oct/16 ] |
|
This has been completed. Docker images for the catalogue and knowledge-base modules are also built and pushed to Docker Hub https://hub.docker.com/r/folioci/ |