Skip to content

Commit 129c4b1

Browse files
authored
Merge pull request #4248 from Microsoft/users/jikuma/dockertaskchangesM116
docker compose linux issue fixed and default values changed
2 parents 58f39ae + 5260124 commit 129c4b1

File tree

9 files changed

+45
-26
lines changed

9 files changed

+45
-26
lines changed

Tasks/Docker/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"loc.friendlyName": "Docker",
3-
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
4-
"loc.description": "Build, push or run Docker images, or run a Docker command",
3+
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
4+
"loc.description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
55
"loc.instanceNameFormat": "$(action)",
66
"loc.group.displayName.advanced": "Advanced Options",
77
"loc.input.label.containerregistrytype": "Container Registry Type",

Tasks/Docker/containerbuild.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function run(connection: ContainerConnection): any {
4545
});
4646

4747
var imageName = tl.getInput("imageName", true);
48+
imageName = imageUtils.changeDefaultImageNameToLowerCase(imageName);
4849
var qualifyImageName = tl.getBoolInput("qualifyImageName");
4950
if (qualifyImageName) {
5051
imageName = connection.qualifyImageName(imageName);

Tasks/Docker/containerimageutils.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
import * as tl from "vsts-task-lib/task";
23

34
export function hasRegistryComponent(imageName: string): boolean {
45
var periodIndex = imageName.indexOf("."),
@@ -18,3 +19,20 @@ export function imageNameWithoutTag(imageName: string): string {
1819
endIndex = imageName.indexOf(":", endIndex);
1920
return endIndex < 0 ? imageName : imageName.substr(0, endIndex);
2021
}
22+
23+
export function changeDefaultImageNameToLowerCase(imageName: string): string {
24+
25+
if(imageName === getDefaultImage())
26+
{
27+
return imageName.toLowerCase();
28+
}
29+
30+
return imageName;
31+
}
32+
33+
function getDefaultImage() : string {
34+
var repositoryName = tl.getVariable('build.repository.name');
35+
var buildId = tl.getVariable('build.buildId');
36+
37+
return repositoryName + ":" + buildId;
38+
}

Tasks/Docker/task.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "E28912F1-0114-4464-802A-A3A35437FD16",
33
"name": "Docker",
44
"friendlyName": "Docker",
5-
"description": "Build, push or run Docker images, or run a Docker command",
5+
"description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
66
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
77
"category": "Build",
88
"visibility": [
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 2,
16-
"Patch": 3
16+
"Patch": 4
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -97,7 +97,7 @@
9797
"name": "defaultContext",
9898
"type": "boolean",
9999
"label": "Use Default Build Context",
100-
"defaultValue": "false",
100+
"defaultValue": "true",
101101
"visibleRule": "action = Build an image",
102102
"helpMarkDown": "Set the build context to the directory that contains the Docker file."
103103
},
@@ -121,7 +121,7 @@
121121
"name": "qualifyImageName",
122122
"type": "boolean",
123123
"label": "Qualify Image Name",
124-
"defaultValue": "false",
124+
"defaultValue": "true",
125125
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
126126
"helpMarkDown": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified."
127127
},

Tasks/Docker/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 2,
16-
"Patch": 3
16+
"Patch": 4
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -97,7 +97,7 @@
9797
"name": "defaultContext",
9898
"type": "boolean",
9999
"label": "ms-resource:loc.input.label.defaultContext",
100-
"defaultValue": "false",
100+
"defaultValue": "true",
101101
"visibleRule": "action = Build an image",
102102
"helpMarkDown": "ms-resource:loc.input.help.defaultContext"
103103
},
@@ -121,7 +121,7 @@
121121
"name": "qualifyImageName",
122122
"type": "boolean",
123123
"label": "ms-resource:loc.input.label.qualifyImageName",
124-
"defaultValue": "false",
124+
"defaultValue": "true",
125125
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
126126
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageName"
127127
},

Tasks/DockerCompose/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"loc.friendlyName": "Docker Compose",
3-
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
4-
"loc.description": "Build, push or run multi-container Docker applications",
3+
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
4+
"loc.description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
55
"loc.instanceNameFormat": "$(action)",
66
"loc.group.displayName.advanced": "Advanced Options",
77
"loc.input.label.containerregistrytype": "Container Registry Type",

Tasks/DockerCompose/dockercompose.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ if (nopIfNoDockerComposeFile && !tl.exist(dockerFile)) {
4444
var action = tl.getInput("action", true);
4545
/* tslint:disable:no-var-requires */
4646
return require({
47-
"Build services": "./dockerComposeBuild",
48-
"Push services": "./dockerComposePush",
49-
"Run services": "./dockerComposeUp",
50-
"Run a specific service": "./dockerComposeRun",
51-
"Lock services": "./dockerComposeLock",
52-
"Write service image digests": "./dockerComposeDigests",
53-
"Combine configuration": "./dockerComposeConfig",
54-
"Run a Docker Compose command": "./dockerComposeCommand"
47+
"Build services": "./dockercomposebuild",
48+
"Push services": "./dockercomposepush",
49+
"Run services": "./dockercomposeup",
50+
"Run a specific service": "./dockercomposerun",
51+
"Lock services": "./dockercomposelock",
52+
"Write service image digests": "./dockercomposedigests",
53+
"Combine configuration": "./dockercomposeconfig",
54+
"Run a Docker Compose command": "./dockercomposecommand"
5555
}[action]).run(connection);
5656
/* tslint:enable:no-var-requires */
5757
})

Tasks/DockerCompose/task.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "6975E2D1-96D3-4AFC-8A41-498B5D34EA19",
33
"name": "DockerCompose",
44
"friendlyName": "Docker Compose",
5-
"description": "Build, push or run multi-container Docker applications",
5+
"description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
66
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
77
"category": "Build",
88
"visibility": [
@@ -12,8 +12,8 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 0,
15-
"Minor": 3,
16-
"Patch": 7
15+
"Minor": 4,
16+
"Patch": 0
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -98,7 +98,7 @@
9898
"name": "qualifyImageNames",
9999
"type": "boolean",
100100
"label": "Qualify Image Names",
101-
"defaultValue": "false",
101+
"defaultValue": "true",
102102
"helpMarkDown": "Qualify image names for built services with the Docker registry connection's hostname if not otherwise specified."
103103
},
104104
{

Tasks/DockerCompose/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 0,
15-
"Minor": 3,
16-
"Patch": 7
15+
"Minor": 4,
16+
"Patch": 0
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -98,7 +98,7 @@
9898
"name": "qualifyImageNames",
9999
"type": "boolean",
100100
"label": "ms-resource:loc.input.label.qualifyImageNames",
101-
"defaultValue": "false",
101+
"defaultValue": "true",
102102
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageNames"
103103
},
104104
{

0 commit comments

Comments
 (0)