Skip to content

Commit

Permalink
fix: git tags introduced in #2232 use incorrect syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ejhayes committed Sep 14, 2022
1 parent 1bf25a5 commit a6031f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 8 additions & 4 deletions plugins/docker/__tests__/docker.test.ts
Expand Up @@ -224,8 +224,9 @@ describe("Docker Plugin", () => {
]);
expect(exec).toHaveBeenCalledWith("git", [
"tag",
"-f",
"latest",
"-mf",
"-m",
'"Tag release alias: latest (1.0.1)"',
]);
expect(exec).toHaveBeenCalledWith("docker", [
Expand Down Expand Up @@ -336,8 +337,9 @@ describe("Docker Plugin", () => {
]);
expect(exec).toHaveBeenCalledWith("git", [
"tag",
"-f",
`pr-${prNumber}`,
"-mf",
"-m",
`Tag pull request canary: pr-${prNumber} (1.0.1-canary.${prNumber}.1)`,
]);
expect(exec).toHaveBeenCalledWith("git", [
Expand Down Expand Up @@ -415,8 +417,9 @@ describe("Docker Plugin", () => {
]);
expect(exec).toHaveBeenCalledWith("git", [
"tag",
"-f",
"next",
"-mf",
"-m",
'"Tag pre-release alias: next (1.0.1-next.0)"',
]);
expect(exec).toHaveBeenCalledWith("git", [
Expand Down Expand Up @@ -481,8 +484,9 @@ describe("Docker Plugin", () => {
]);
expect(exec).toHaveBeenCalledWith("git", [
"tag",
"-f",
expectedAlias,
"-mf",
"-m",
`"Tag pre-release alias: ${expectedAlias} (1.0.1-${expectedAlias}.0)"`,
]);
expect(exec).toHaveBeenCalledWith("git", [
Expand Down
8 changes: 5 additions & 3 deletions plugins/docker/src/index.ts
Expand Up @@ -151,8 +151,9 @@ export default class DockerPlugin implements IPlugin {
if (this.options.tagLatest) {
await execPromise("git", [
"tag",
"-f",
aliasTag,
"-mf",
"-m",
`"Tag release alias: ${aliasTag} (${prefixedTag})"`
]);
}
Expand Down Expand Up @@ -209,7 +210,7 @@ export default class DockerPlugin implements IPlugin {
const aliasImage = `${this.options.registry}:${canaryAliasVersion}`;
await execPromise("docker", ["tag", this.options.image, aliasImage]);
await execPromise("docker", ["push", aliasImage]);
await execPromise("git", ["tag", `${canaryAliasVersion}`, "-mf", `Tag pull request canary: ${canaryAliasVersion} (${canaryVersion})`]);
await execPromise("git", ["tag", "-f", `${canaryAliasVersion}`, "-m", `Tag pull request canary: ${canaryAliasVersion} (${canaryVersion})`]);
await execPromise("git", ["push", auto.remote, `refs/tags/${canaryAliasVersion}`, "-f"]);
}

Expand Down Expand Up @@ -269,8 +270,9 @@ export default class DockerPlugin implements IPlugin {
if (this.options.tagPrereleaseAliases) {
await execPromise("git", [
"tag",
"-f",
prereleaseAlias,
"-mf",
"-m",
`"Tag pre-release alias: ${prereleaseAlias} (${prerelease})"`,
]);
await execPromise("docker", ["tag", this.options.image, aliasImage]);
Expand Down

0 comments on commit a6031f0

Please sign in to comment.