|
| 1 | +# metalink-upgrader-pipeline |
| 2 | + |
| 3 | +For managing a [BOSH](https://bosh.io) release pipeline which upgrades blobs from [metalink repositories](https://github.com/dpb587/metalink/tree/master/repository#metalink-repository). |
| 4 | + |
| 5 | + |
| 6 | +## Usage |
| 7 | + |
| 8 | +A `config/blobs/{blobname}/repository.yml` defines the metalink repository where the blob versions are mirrored. |
| 9 | + |
| 10 | + uri: git+https://github.com/dpb587/upstream-blob-mirror.git//repository/icu4c |
| 11 | + version: ^58 |
| 12 | + |
| 13 | +A pipeline defines the basic configuration for an upgrader pipeline (`ci/pipelines/upgrader.yml`) which defines, at a minimum, a `repo` resource which references the release repository. After a blob upgrade is triggered, the `config.after_upload_blobs` setting configures what happens after the blobs have been synced. |
| 14 | + |
| 15 | + config: |
| 16 | + after_sync_blobs: # run integration tests with a dev release of the new blob |
| 17 | + - task: create-dev-release |
| 18 | + file: repo/ci/tasks/create-dev-release/task.yml |
| 19 | + - task: integration-test |
| 20 | + file: repo/ci/tasks/integration-test/task.yml |
| 21 | + privileged: true |
| 22 | + after_upload_blobs: # push the new blobs to the repo |
| 23 | + - put: repo |
| 24 | + params: |
| 25 | + repository: repo |
| 26 | + resources: |
| 27 | + - name: repo # the bosh release repository |
| 28 | + type: git |
| 29 | + source: |
| 30 | + uri: git@github.com:dpb587/openvpn-bosh-release.git |
| 31 | + branch: master |
| 32 | + private_key: ((repo_private_key)) |
| 33 | + |
| 34 | +Once the blobs and base pipeline have been configured, `metalink-upgrader-pipeline` can be used to generate a pipeline. The generated pipeline will have a new job to handle updates to the upstream blobs. By configuring steps for `after_upload_blobs`, a `bosh upload-blobs` step will first be executed. The job will require several variables to be set: `release_private_yml` (for uploading blobs to the blobstore) and `maintainer_email`, `maintainer_name` (for the `git` commit). |
| 35 | + |
| 36 | + fly set-pipeline -p openvpn:upgrader \ |
| 37 | + -c <( metalink-upgrader-pipeline ci/pipelines/upgrader.yml ) \ |
| 38 | + -l <( lpass show 'pipeline=openvpn:upgrader' ) |
| 39 | + |
| 40 | +The blob jobs automatically trigger whenever a new version is available. When syncing blobs, old blobs in the directory are removed, new blobs are added (not yet uploaded), and a copy of the origin metalink is staged to `config/blobs/{blobname}/metalink.meta4`. When uploading blobs, `config/blobs.yml` is updated with the new blobstore references, and any other already-staged files are committed. After uploading blobs, the repository should be pushed. |
| 41 | + |
| 42 | + |
| 43 | +## Examples |
| 44 | + |
| 45 | +A couple public repositories using this to manage some upstream dependencies. |
| 46 | + |
| 47 | +* [dpb587/openvpn-bosh-release](https://github.com/dpb587/openvpn-bosh-release) |
| 48 | +* [dpb587/ssoca-bosh-release](https://github.com/dpb587/ssoca-bosh-release) |
0 commit comments