Adapt Docker tools for pre-publishing flow
- Dominant language
- Java
- Stars
- 107
- Forks
- 29
- Avg merge
- 19h 46m
- Merged PRs (30d)
- 141
Description
### Description / Background
We'd like to be able to configure an alternative repository when we've pre-published the container images for the Docker tools CLI.
We'd like to be able to run the install script for a specific version of the Git repository held locally, as well as by downloading the script directly from GitHub.
### Technical Notes / Implementation Details
See the parent issue for details of the Docker tools setup and the configuration file we want to add.
#### Container registry configuration
The `runInDocker.sh` script has the container registry hard coded to `ghcr.io/gchq`, which is GitHub Container Registry.
We'll want to be able to set this configuration either through the install script, or as a command in the CLI. We can add a command to `runInDocker.sh` to set it, and call that from `install.sh`. This would be similar to the existing `cli pull-images` subcommand, which is already used in the install script.
#### Docker tags
When retrieving Docker images, we currently always use the "latest" tag. Instead, if the CLI was installed from a local Git repository, and a custom container registry is set, we can retrieve the version number from the local Git repository by grepping the pom.xml or checking `scripts/templates/version.txt`.
#### Retrieve CLI script from local repository
We can adapt the install script to have an option to find `runInDocker.sh` locally rather than downloading it from GitHub.
Here are some options:
1. Pass an extra argument that's either a flag to find that script as a relative path, or an argument that's the full path to that file.
2. No extra argument, just check if the `runInDocker.sh` script exists at a relative path and use it if it's there.
The second option would be simpler to use, and would automatically use the local code if you've cloned the repository locally.
#### Upgrade CLI script from local repository
The `sleeper cli upgrade` command currently assumes that the `runInDocker.sh` script was downloaded from the GitHub `develop` branch, and re-downloads it from there. If it was installed from a local Git repository, we'll need to retrieve it from there instead.
Contributor guide
Assessment
This issue has not been assessed yet.