diff --git a/README.md b/README.md index c28684f7..e11e8d59 100644 --- a/README.md +++ b/README.md @@ -808,7 +808,7 @@ non-idempotent targets, not for the Docker target. | `source` | Path to the source Docker image to be pulled | | `sourceFormat` | Format for the source image name. Default: `{{source}}:{{revision}}` | | `target` | Path to the target Docker image to be pushed | -| `targetFormat` | Format for the target image name. Default: `{{target}}:{{release}}` | +| `targetFormat` | Format for the target image name. Default: `{{target}}:{{version}}` | **Example** diff --git a/src/targets/docker.ts b/src/targets/docker.ts index 58ab03dc..d4b3a73c 100644 --- a/src/targets/docker.ts +++ b/src/targets/docker.ts @@ -23,7 +23,7 @@ export interface DockerTargetOptions extends TargetConfig { source: string; /** Full name template for the source image path, defaults to `{{source}}:{{revision}}` */ sourceTemplate: string; - /** Full name template for the target image path, defaults to `{{target}}:{{release}}` */ + /** Full name template for the target image path, defaults to `{{target}}:{{version}}` */ targetTemplate: string; /** Target image path, like `getsentry/craft` */ target: string; @@ -66,7 +66,7 @@ export class DockerTarget extends BaseTarget { source: this.config.source, target: this.config.target, sourceTemplate: this.config.sourceFormat || '{{source}}:{{revision}}', - targetTemplate: this.config.targetFormat || '{{target}}:{{release}}', + targetTemplate: this.config.targetFormat || '{{target}}:{{version}}', username: process.env.DOCKER_USERNAME, }; } @@ -106,16 +106,16 @@ export class DockerTarget extends BaseTarget { /** * Pushes the locally tagged source image to Docker Hub * @param sourceRevision The tag/revision for the source image - * @param targetTag The target tag (release version) for the target image + * @param version The release version for the target image */ - public async push(sourceRevision: string, targetTag: string): Promise { + public async push(sourceRevision: string, version: string): Promise { const sourceImage = renderTemplateSafe(this.dockerConfig.sourceTemplate, { ...this.dockerConfig, revision: sourceRevision, }); const targetImage = renderTemplateSafe(this.dockerConfig.targetTemplate, { ...this.dockerConfig, - release: targetTag, + version, }); logger.debug('Tagging target image...'); await spawnProcess(DOCKER_BIN, ['tag', sourceImage, targetImage]);