[FOLIO-2303] documentation for setting up deployment of feature branches Created: 08/Oct/19  Updated: 03/Jun/20  Resolved: 18/Oct/19

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: New Feature Priority: P2
Reporter: Jakub Skoczen Assignee: Ian Hardy
Resolution: Done Votes: 0
Labels: platform-backlog
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Relates
relates to FOLIO-2401 Create a demonstration for 'PR Preview' Closed
Sprint: CP: sprint 74
Story Points: 2
Development Team: Core: Platform

 Description   

Ian Hardy will provide more details.

  • Document the setting in Jenkins file to enable the branch deployment.
  • Document how to refer to branch artefacts in the platform- PRs. (both for backend and for front-end)

The published document is at https://dev.folio.org/guides/branch-preview-kubernetes/



 Comments   
Comment by Ian Hardy [ 16/Oct/19 ]

Here's more or less the documentation on publishing backend preview artifacts. There's alittle re-wrting to be done yet on dev.folio.org to fit it in.

Publishing backend preview artifacts

It may be desirable to create preview build that includes changes to backend modules that have not been merged into master. To achieve this, open a pull request on the backend module or modules with the publishPreview variable set to true in the main config, and in the docker configuration. A Jenkinsfile for a typical backend module might look like this:

buildMvn {
  publishModDescriptor = 'yes'
  publishAPI = 'yes'
  mvnDeploy = 'yes'
  runLintRamlCop = 'yes'
  publishPreview = 'yes'

  doDocker = {
    buildJavaDocker {
      publishMaster = 'yes'
      publishPreview = 'yes'
      healthChk = 'yes'
      healthChkCmd = 'curl -sS --fail -o /dev/null  http://localhost:8081/apidocs/ || exit 1'
    }
  }
}

Making these changes will achieve the following:
If the docker build is successful, the image will be deployed temporarily to an internal docker registry at repository.folio.org. The image will be tagged with the version number, the pr number, and the build number. For example, mod-users-15.6.1-SNAPSHOT.11.2 where “15.6.1-SNAPSHOT” is the version, 11 is the PR number, and 2 is the build number.
A modified module descriptor will be posted to okapi-preview.ci.folio.org
The module will be deployed to the preview CI kubernetes namespace.

Including backend preview artifacts in a platform

Preview builds are driven by pull requests against platform-core or platform-complete. To include a preview artifact, update the okapi-install.json file and replace the id of the module you would like to preview with the preview version. The preview version is the module’s regular version number, with the pr and build numbers appended (mod-name-version.pr.build.) For example:

...
{
  "id": "mod-users-SNAPSHOT-15.6.1",
  "action": "enable"
},...

should be replaced with:

...
{
  "id": "mod-users-SNAPSHOT-15.6.1.11.2",
  "action": "enable"
},...

Bear in mind that the module descriptor for this preview artifact is not published to the folio-registry, and is only available on okapi-preview.ci.folio.org.

Comment by Jakub Skoczen [ 16/Oct/19 ]

Ian Hardy John Malconian Looks pretty good! To complete it we should also extend it with a section explaining how to add NPM branch "artefacts" to the platform-core (and to individual UI modules). I think John mentioned that the approach here is to point to the specific Git branch directly in the package.json and omit using the Nexus NPM repository altogether. Is that the recommended approach? Do we need to confirm with the UI developers (e.g Zak Burke?). If so, John Malconian will you contribute this section or can Ian Hardy handle it?

Comment by Zak Burke [ 17/Oct/19 ]

For UI modules, pointing directly to a GitHub branch of the module in the platform's package.json file sounds like the right approach to me.

Comment by Ian Hardy [ 18/Oct/19 ]

Opened a PR for dev.folio.org with draft documentation for creating a k8s preview. This will need to be reviewed for accuracy when pr preview is enabled. There are notes on what is needed in the PR: https://github.com/folio-org/folio-org.github.io/pull/478

The generated document associated with that PR is available here.

Comment by David Crossley [ 29/Jan/20 ]

Re-opened this because the documentation is not yet finalised.

There are some notes above to be incorporated, and notes on the PR. There are some notes in private Slack. There might also be related notes arising from FOLIO-2401 Closed .

Generated at Thu Feb 08 23:19:41 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.