Skip to content

Latest commit

 

History

History
93 lines (64 loc) · 2.92 KB

README.adoc

File metadata and controls

93 lines (64 loc) · 2.92 KB

Incremental Build Publisher

This service is responsible for uploading incrementally built (see JEP-305) core and plugin artifacts into the incrementals Maven repository (see IEP-9).

Environment Variables

Variable Description

GITHUB_APP_ID

The App ID for a GitHub app

GITHUB_APP_PRIVATE_KEY

The private key for a GitHub app

GITHUB_APP_INSTALLATION_ID

The installation ID for the organisation / user account that the GitHub app has been installed to

JENKINS_HOST

A Jenkins instance (defaults to https://ci.jenkins.io/) to which URLs are expected to conform.

INCREMENTAL_URL

A Maven repository which should be treated as the incrementals destination, defaults to https://repo.jenkins-ci.org/incrementals/

ARTIFACTORY_KEY

An Artifactory user’s API key (from the user profile in Artifactory)

PERMISSIONS_URL

A URL pointing to the generated repository-permissions-updater output, defaults to https://ci.jenkins.io/job/Infra/job/repository-permissions-updater/job/master/lastSuccessfulBuild/artifact/json/github.index.json

JENKINS_AUTH

A username:password or username:apiToken authentication to Jenkins. API Token

PRESHARED_KEY

A string that is required for Authorization: Bearer $token authentication to allow access

Optional/Development Variables

Variable Description

BUILD_METADATA_URL

URL which will serve up JSON which represents metadata about a Pipeline Run (example)

FOLDER_METADATA_URL

Same but for metadata of the repository folder.

ARCHIVE_URL

URL to a .zip file which represents an example release zip generated by the incrementals release tooling.

Valid Requests

This service only supports one kind of request, and is expected to only be called by the buildPlugin() step or other Jenkins Pipelines which are publishing incrementally built artifacts into Artifactory.

{
  "build_url" : "https://ci.jenkins.io/job/structs-plugin/job/PR-36/3/"
}

This URL is expected to be the value of a BUILD_URL environment variable from Jenkins.

Testing

Unit tests can simply be run by executing make check in this directory.

For acceptance testing, please set the appropriate Environment Variables in a terminal and then execute make run in the repository root directory.

Once the Azure Functions container has come online, requests can be sent to the Function, for example:

curl -H "Authorization: Bearer ${PRESHARED_KEY}" -H 'Content-Type: application/json' -i -d '{"build_url":"https://ci.jenkins.io/job/Plugins/job/jenkins-infra-test-plugin/job/master/52/"}' http://localhost:3000