|
| 1 | +# Building the RSCT Images |
| 2 | +### Export Environment Variables |
| 3 | +Before building the images, export the necessary environment variables if reuired. |
| 4 | +For example: |
| 5 | +``` |
| 6 | +# Registry where images will be pushed |
| 7 | +# Default value is ghcr.io/ocp-power-automation/rsct-operator |
| 8 | +export IMAGE_TAG_BASE=ghcr.io/ocp-power-automation/rsct-operator |
| 9 | +
|
| 10 | +# Current version of the operator to build |
| 11 | +# Default value is set to the current released version at the ghcr.io/ocp-power-automation/rsct-operator registry |
| 12 | +export VERSION=0.0.1-alpha3 |
| 13 | +
|
| 14 | +# Set the pervious version to the latest released operator version |
| 15 | +# Default value is set to the pervious released version at the ghcr.io/ocp-power-automation/rsct-operator registry |
| 16 | +export PREVIOUS_VERSION=0.0.1-alpha2 |
| 17 | +
|
| 18 | +# Container tool (docker or podman) |
| 19 | +# Default is set to podman |
| 20 | +export CONTAINER_TOOL=docker |
| 21 | +
|
| 22 | +# To use a different registry for adding multiple operators in the new catalog source index, export the new registry and set the correct PREVIOUS_VERSION |
| 23 | +# Default value is ghcr.io/ocp-power-automation/rsct-operator |
| 24 | +export PREVIOUS_IMAGE_TAG_BASE=ghcr.io/ocp-power-automation/rsct-operator |
| 25 | +``` |
| 26 | + |
| 27 | +### Update the Catalog Index |
| 28 | +Before building the catalog, update the index `entries` in *catalog/index.yaml*. Ensure all `entries` match the `bundles` available in the catalog source. |
| 29 | + |
| 30 | +For example, if you are building the following version: |
| 31 | +``` |
| 32 | +export VERSION=0.0.1-alpha3 |
| 33 | +export PREVIOUS_VERSION=0.0.1-alpha2 |
| 34 | +``` |
| 35 | +Add the new entry for `VERSION=0.0.1-alpha3` in *catalog/index.yaml*: |
| 36 | +``` |
| 37 | + - name: rsct-operator.v0.0.1-alpha3 |
| 38 | + replaces: rsct-operator.v0.0.1-alpha2 |
| 39 | +``` |
| 40 | +After adding the new version, the `entries` in [catalog/index.yaml](https://github.com/ocp-power-automation/rsct-operator/blob/main/catalog/index.yaml) will look like this: |
| 41 | +``` |
| 42 | +--- |
| 43 | +schema: olm.channel |
| 44 | +package: rsct-operator |
| 45 | +name: alpha |
| 46 | +entries: |
| 47 | + - name: rsct-operator.v0.0.1-alpha0 |
| 48 | + - name: rsct-operator.v0.0.1-alpha1 |
| 49 | + replaces: rsct-operator.v0.0.1-alpha0 |
| 50 | + - name: rsct-operator.v0.0.1-alpha2 |
| 51 | + replaces: rsct-operator.v0.0.1-alpha1 |
| 52 | + - name: rsct-operator.v0.0.1-alpha3 |
| 53 | + replaces: rsct-operator.v0.0.1-alpha2 |
| 54 | +``` |
| 55 | +**Note:** |
| 56 | +Before pushing the images, make sure you are logged in to the registry: |
| 57 | +``` |
| 58 | +docker login <registry> |
| 59 | +``` |
| 60 | + |
| 61 | +## Building and Pushing Images |
| 62 | +1. Build and push the operator image |
| 63 | + |
| 64 | +**Single architecture image (ppc64le)** |
| 65 | +``` |
| 66 | +make docker-build docker-push |
| 67 | +``` |
| 68 | + |
| 69 | +**Multi-architecture image** |
| 70 | +``` |
| 71 | +make docker-buildx |
| 72 | +``` |
| 73 | + |
| 74 | +2. Build and push the bundle image |
| 75 | +``` |
| 76 | +make bundle bundle-build bundle-push |
| 77 | +``` |
| 78 | + |
| 79 | +3. Build and push the catalog images |
| 80 | +``` |
| 81 | +make catalog-build catalog-push |
| 82 | +```` |
| 83 | +This will build and push the catalog image with the version tag `v0.0.1-alpha3` and `latest`. |
0 commit comments